@@ -68,39 +68,47 @@ build.gradle as an example:
6868
6969.. code-block :: groovy
7070
71- apply plugin: 'java'
71+ plugins {
72+ id 'java'
73+ }
74+
75+ ext.domaResources = ['doma.compile.config', 'META-INF/**/*.sql', 'META-INF/**/*.script']
7276
73- // Copy the resources referred by the Doma annotation processors to
74- // the destinationDir of the compileJava task
75- task copyDomaResources(type: Sync) {
77+ task copyDomaResources(type: Sync) {
7678 from sourceSets.main.resources.srcDirs
7779 into compileJava.destinationDir
78- include 'doma.compile.config'
79- include 'META-INF/**/*.sql'
80- include 'META-INF/**/*.script'
80+ include domaResources
8181 }
8282
8383 compileJava {
84- // Depend on the above task
84+ // copy doma related resources before compileJava
8585 dependsOn copyDomaResources
8686 options.encoding = 'UTF-8'
8787 }
8888
89+ processResources {
90+ // exclude doma related resources
91+ exclude domaResources
92+ }
93+
8994 compileTestJava {
9095 options.encoding = 'UTF-8'
91- // Disable the annotation processors during the test run
96+ // disable the annotation processors during the test run
9297 options.compilerArgs = ['-proc:none']
9398 }
9499
100+ repositories {
101+ mavenCentral()
102+ maven {url 'https://oss.sonatype.org/content/repositories/snapshots/'}
103+ }
104+
95105 dependencies {
96106 annotationProcessor "org.seasar.doma:doma:2.28.1-SNAPSHOT"
97107 implementation "org.seasar.doma:doma:2.28.1-SNAPSHOT"
108+ runtimeOnly 'com.h2database:h2:1.3.175'
109+ testImplementation 'junit:junit:4.11'
98110 }
99111
100- repositories {
101- mavenCentral()
102- maven {url 'https://oss.sonatype.org/content/repositories/snapshots/'}
103- }
104112
105113 .. note ::
106114
0 commit comments