Skip to content

Commit 871d8d9

Browse files
committed
Support Kotlin
1 parent a03248d commit 871d8d9

File tree

49 files changed

+944
-73
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+944
-73
lines changed

README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,43 @@ The plugin is equivalent to the following gradle script:
1818
```groovy
1919
def domaResources = ['doma.compile.config', 'META-INF/**/*.sql', 'META-INF/**/*.script']
2020
21-
task syncDomaResources(type: Sync) {
21+
task syncDomaResourcesJava(type: Sync) {
2222
from sourceSets.main.resources.srcDirs
2323
into compileJava.destinationDir
2424
include domaResources
2525
}
2626
2727
compileJava {
28-
dependsOn syncDomaResources
28+
dependsOn syncDomaResourcesJava
2929
}
3030
3131
processResources {
3232
exclude domaResources
3333
}
34+
35+
task syncDomaResourcesKotlin(type: Sync) {
36+
from sourceSets.main.resources.srcDirs
37+
into kotlinJava.destinationDir
38+
include domaResources
39+
}
40+
41+
compileKotlin {
42+
dependsOn syncDomaResourcesKotlin
43+
}
44+
45+
kapt {
46+
arguments {
47+
arg("doma.resources.dir", compileKotlin.destinationDir)
48+
}
49+
}
3450
```
3551

52+
Example build.gradle
53+
--------------------
54+
55+
- Java: https://github.com/domaframework/simple-examples/blob/master/build.gradle
56+
- Kotlin: https://github.com/domaframework/kotlin-sample/blob/master/build.gradle
57+
3658
License
3759
-------
3860

File renamed without changes.

compile-test/build.gradle renamed to compile-java-test/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ java {
1919
targetCompatibility = JavaVersion.VERSION_1_8
2020
}
2121

22+
test {
23+
useJUnitPlatform()
24+
}
25+
2226
repositories {
2327
mavenCentral()
2428
mavenLocal()
@@ -28,4 +32,6 @@ repositories {
2832
dependencies {
2933
annotationProcessor "org.seasar.doma:doma:$domaVersion"
3034
implementation "org.seasar.doma:doma:$domaVersion"
35+
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.1'
36+
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.1'
3137
}
File renamed without changes.
File renamed without changes.

compile-java-test/settings.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
rootProject.name = 'compile-java-test'
2+
3+
includeBuild '../compile'

0 commit comments

Comments
 (0)