Skip to content

Commit 7801db0

Browse files
authored
Merge pull request #354 from domaframework/doc
Simplify descriptions about build
2 parents 6577fe6 + 2f9d94e commit 7801db0

File tree

9 files changed

+50
-157
lines changed

9 files changed

+50
-157
lines changed

docs/annotation-processing.rst

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -71,25 +71,6 @@ doma.config.path
7171
The file path of the configuration file for Doma.
7272
The default value is ``doma.compile.config``.
7373

74-
Setting options in Eclipse
75-
==========================
76-
77-
- Select “Project > Properties” from the menu bar and open the dialog
78-
- Select “Java Compiler > Annotation Processing” from the left menu of the dialog
79-
- Add "Processor options"
80-
81-
Setting options in IntelliJ IDEA
82-
================================
83-
84-
- Select "Preferrences" from the menu bar and open the dialog
85-
- Select "Build, Execution, Deployment > Compiler > Annotation Processors" from the left menu of the dialog
86-
- Add "Annotation Processor options"
87-
88-
Setting options in javac
89-
========================
90-
91-
- Use `the -A option <https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javac.html#BHCDIFEE>`_
92-
9374
Setting options in Gradle
9475
=========================
9576

@@ -104,6 +85,18 @@ Setting options in Gradle
10485
}
10586
}
10687
88+
Setting options in IntelliJ IDEA
89+
================================
90+
91+
Import your project as a Gradle project.
92+
In the case, the options written in build.gradle are used.
93+
94+
Setting options in Eclipse
95+
==========================
96+
97+
Generate eclipse setting files
98+
by using the Gradle plugin `com.diffplug.eclipse.apt<https://plugins.gradle.org/plugin/com.diffplug.eclipse.apt>`_.
99+
107100
Setting options with configuration file
108101
=======================================
109102

docs/build.rst

Lines changed: 18 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -19,106 +19,37 @@ The group id and artifact id are as follows:
1919

2020
See also: https://search.maven.org/artifact/org.seasar.doma/doma/
2121

22-
.. _eclipse-build:
23-
24-
Build with Eclipse
25-
==================
26-
27-
.. note::
28-
29-
Instead of manual settings we show you below,
30-
we recommend to generate eclipse setting files automatically with
31-
`the Gradle Eclipse Plugin <https://docs.gradle.org/current/userguide/eclipse_plugin.html>`_.
32-
See also build.gradle and eclipse.gradle in the
33-
`domaframework/simple-boilerplate <https://github.com/domaframework/simple-boilerplate>`_
34-
repository.
35-
36-
Enabling annotation processing
37-
------------------------------
38-
39-
- Select "Project > Properties" from the menu bar and open the dialog
40-
- Select "Java Compiler > Annotation Processing" from the left menu of the dialog
41-
- Check as follows:
42-
43-
.. image:: images/annotation-processing.png
44-
:width: 80 %
45-
46-
Setting factory path
47-
--------------------
48-
49-
- Select "Project > Properties" from the menu bar and open the dialog
50-
- Select "Java Compiler > Annotation Processing > Factory Path" from the left menu of the dialog
51-
- Add the jar file of the Doma framework whose version is same as the one in the Java Build Path
52-
- Check as follows:
53-
54-
.. image:: images/factory-path.png
55-
:width: 80 %
56-
57-
Build with IntelliJ IDEA
58-
========================
59-
60-
See :ref:`idea-annotation-processor`.
61-
6222
.. _build-with-gradle:
6323

6424
Build with Gradle
6525
=================
6626

67-
build.gradle as an example:
68-
69-
.. code-block:: groovy
70-
71-
plugins {
72-
id 'java'
73-
}
74-
75-
ext.domaResources = ['doma.compile.config', 'META-INF/**/*.sql', 'META-INF/**/*.script']
27+
Write your build.gradle script, then run ``gradle build``.
7628

77-
task copyDomaResources(type: Sync) {
78-
from sourceSets.main.resources.srcDirs
79-
into compileJava.destinationDir
80-
include domaResources
81-
}
29+
To simplify your build.script, we recommend you use
30+
the `Doma Compile Plugin`_.
8231

83-
compileJava {
84-
// copy doma related resources before compileJava
85-
dependsOn copyDomaResources
86-
options.encoding = 'UTF-8'
87-
}
32+
See build.gradle in the `simple-boilerplate`_ repository as an example.
8833

89-
processResources {
90-
// exclude doma related resources
91-
exclude domaResources
92-
}
93-
94-
compileTestJava {
95-
options.encoding = 'UTF-8'
96-
// disable the annotation processors during the test run
97-
options.compilerArgs = ['-proc:none']
98-
}
34+
Build with IntelliJ IDEA
35+
========================
9936

100-
repositories {
101-
mavenCentral()
102-
maven {url 'https://oss.sonatype.org/content/repositories/snapshots/'}
103-
}
37+
Use a newer version of IntelliJ IDEA, and then import your project as a Gradle project.
38+
To know how to import project, see :ref:`idea-import-project`.
10439

105-
dependencies {
106-
annotationProcessor "org.seasar.doma:doma:2.28.1-SNAPSHOT"
107-
implementation "org.seasar.doma:doma:2.28.1-SNAPSHOT"
108-
runtimeOnly 'com.h2database:h2:1.3.175'
109-
testImplementation 'junit:junit:4.11'
110-
}
40+
.. _eclipse-build:
11141

42+
Build with Eclipse
43+
==================
11244

113-
.. note::
45+
Generate eclipse setting files with Gradle, and then import your project into Eclipse.
46+
To generate the setting files, run ``gradle eclipse``.
11447

115-
The description ``maven {url 'https://oss.sonatype.org/content/repositories/snapshots/'}`` is required
116-
only when you need the SNAPSHOT version of the Doma framework.
48+
To simplify your build.script, we recommend you use the `Doma Compile Plugin`_ and the `AptEclipsePlugin`_.
11749

118-
.. note::
50+
See build.gradle in the `simple-boilerplate`_ repository as an example.
11951

120-
With the above build.gradle, you will benefits from
121-
`Incremental annotation processing <https://gradle.org/whats-new/gradle-5/#incremental-annotation-processing>`_.
12252

123-
See also build.gradle in the
124-
`domaframework/simple-boilerplate <https://github.com/domaframework/simple-boilerplate>`_ repository.
53+
.. _Doma Compile Plugin: https://github.com/domaframework/doma-compile-plugin
54+
.. _AptEclipsePlugin: https://plugins.gradle.org/plugin/com.diffplug.eclipse.apt
55+
.. _simple-boilerplate: https://github.com/domaframework/simple-boilerplate

docs/faq.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Runtime environment
3131
Which version of JRE does Doma support?
3232
---------------------------------------
3333

34-
JRE 8, 9, 10, 11 and 12.
34+
JRE 8, 9, 10, 11, 12, 13 and 14.
3535

3636
Which libraries are required for Doma to work?
3737
----------------------------------------------
@@ -48,7 +48,7 @@ Development environment
4848
Which version of JDK does Doma support?
4949
---------------------------------------
5050

51-
JDK 8, 9, 10, 11 and 12.
51+
JDK 8, 9, 10, 11, 12, 13 and 14.
5252

5353
Which IDE do you recommend?
5454
---------------------------

docs/getting-started-eclipse.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Create config file for Eclipse by next command.
114114

115115
.. note::
116116

117-
Please set JDK 8 (or JDK 9 and 10) installed directory to environment variable ``JAVA_HOME``.
117+
Please set JDK 8 (or later) installed directory to environment variable ``JAVA_HOME``.
118118
It is needed for executing gradlew.
119119

120120
.. note::

docs/getting-started-idea.rst

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ Install `IntelliJ IDEA Community Edition`_ .
3333

3434
.. note::
3535

36-
In this document, we use IntelliJ IDEA Community Edition 2019.2.1 as IDE.
37-
If you use IntelliJ IDEA Ultimate Edition, recommend to you concomitant use with `IntelliJ Doma support plugin`_.
36+
In this document, we use IntelliJ IDEA 2019.3.4 (Community Edition).
37+
We recommend you use a newer version because the integration with Gradle is much better.
38+
If you use IntelliJ IDEA Ultimate Edition, consider to use `IntelliJ Doma support plugin`_.
39+
40+
.. _idea-import-project:
3841

3942
Import template project
4043
============================
@@ -50,8 +53,6 @@ Start IntelliJ IDEA and execute Import Project, and select the cloned simple-boi
5053
.. image:: images/idea-welcome.png
5154
:width: 60 %
5255

53-
|
54-
5556
Check Import project from external model and select Gradle:
5657

5758
.. image:: images/idea-import-project.png
@@ -60,28 +61,6 @@ Check Import project from external model and select Gradle:
6061
Push the Finish button.
6162
If the message that is synced successfully is shown at Build tool window then import is success.
6263

63-
.. _idea-annotation-processor:
64-
65-
Setting of Annotation Processor
66-
================================
67-
68-
Open Build, Execution, Deployment > Compiler > Annotation Processors from Preferences.
69-
Check Enable annotation processing:
70-
71-
.. image:: images/idea-annotation-processors.png
72-
:width: 100 %
73-
74-
Setting of Build and Run
75-
================================
76-
77-
Open Build, Execution, Deployment > Build Tools > Gradle from Preferences.
78-
Choose IntelliJ IDEA for Run tests using:
79-
80-
.. image:: images/run-tests-using.png
81-
:width: 100 %
82-
83-
Try to build and run test cases.
84-
8564
Structure of template project
8665
==============================
8766

-238 KB
Binary file not shown.

docs/images/idea-welcome.png

11.7 KB
Loading

docs/index.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Doma has various strengths:
2424

2525
This document consists of following sections:
2626

27-
* `User Documentation`_
27+
* `User Documentation`_u
2828
* `Developer Documentation`_
2929
* `About Doma`_
3030
* `Links`_
@@ -43,8 +43,8 @@ User Documentation
4343
.. toctree::
4444
:maxdepth: 2
4545

46-
getting-started-eclipse
4746
getting-started-idea
47+
getting-started-eclipse
4848
config
4949
basic
5050
domain
@@ -84,7 +84,9 @@ Links
8484
* `News and announcements <https://twitter.com/domaframework>`_
8585
* `GitHub repository <https://github.com/domaframework/doma>`_
8686
* `JavaDoc <http://www.javadoc.io/doc/org.seasar.doma/doma>`_
87+
* `Boilerplate <https://github.com/domaframework/simple-boilerplate>`_
8788
* `Examples <https://github.com/domaframework/simple-examples>`_
88-
* `Doma-Gen <http://doma-gen.readthedocs.org/>`_
89-
* `Doma 1 <http://doma.seasar.org/>`_
89+
* `Doma Compile Plugin <https://github.com/domaframework/doma-compile-plugin>`_
90+
* `Doma CodeGen Plugin <https://github.com/domaframework/doma-codegen-plugin>`_
91+
* `Doma version 1 <http://doma.seasar.org/>`_
9092

docs/kotlin-support.rst

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -103,28 +103,16 @@ Add the dependencies using the `kapt` and `implementation` configuration in your
103103
implementation "org.seasar.doma:doma:2.28.1-SNAPSHOT"
104104
}
105105
106-
If you use resource files such as SQL files, make the kapt find them:
106+
To simplify your build.script, we recommend you use
107+
the `Doma Compile Plugin <https://github.com/domaframework/doma-compile-plugin>`_:
107108
108109
.. code-block:: groovy
109110
110-
kapt {
111-
arguments {
112-
arg("doma.resources.dir", compileKotlin.destinationDir)
113-
}
114-
}
115-
116-
task copyDomaResources(type: Sync) {
117-
from sourceSets.main.resources.srcDirs
118-
into compileKotlin.destinationDir
119-
include 'doma.compile.config'
120-
include 'META-INF/**/*.sql'
121-
include 'META-INF/**/*.script'
122-
}
123-
124-
compileKotlin {
125-
dependsOn copyDomaResources
126-
}
111+
plugins {
112+
id 'org.seasar.doma.compile' version '1.0.0'
113+
}
127114
115+
For more details, see this `build.gradle <https://github.com/domaframework/kotlin-sample/blob/master/build.gradle>`_.
128116
129117
.. note::
130118

0 commit comments

Comments
 (0)