Visitar URL original
build: api/impl separation, compile avoidance and incremental compile · apache/polygene-java@c8eb9bd · GitHub
Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit c8eb9bd

Browse files
committed
build: api/impl separation, compile avoidance and incremental compile
Leverage the new java-library plugin and now stable incremental java compilation. Benefits: - API and implementation separation - compile avoidance when making ABI compatible changes - incremental compilation of java sources See https://docs.gradle.org/current/userguide/java_library_plugin.html and https://docs.gradle.org/current/release-notes.html#faster-java-incremental-compilation
1 parent 16c9ccb commit c8eb9bd

82 files changed

Lines changed: 621 additions & 576 deletions

File tree

Some content is hidden

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

‎buildSrc/src/main/groovy/org/apache/polygene/gradle/code/CodePlugin.groovy‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,14 @@ class CodePlugin implements Plugin<Project>
5454

5555
private static void applyJava( Project project )
5656
{
57-
project.plugins.apply 'java'
57+
project.plugins.apply 'java-library'
5858
def javaConvention = project.convention.getPlugin JavaPluginConvention
5959
javaConvention.targetCompatibility = JavaVersion.VERSION_1_8
6060
javaConvention.sourceCompatibility = JavaVersion.VERSION_1_8
6161
project.tasks.withType( JavaCompile ) { JavaCompile task ->
6262
task.options.encoding = 'UTF-8'
6363
task.options.compilerArgs << '-Xlint:deprecation'
64+
task.options.incremental = true
6465
}
6566
}
6667

‎buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/tests/PerformanceTestsPlugin.groovy‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ class PerformanceTestsPlugin implements Plugin<Project>
4444
{
4545
def sourceSets = project.convention.getPlugin( JavaPluginConvention ).sourceSets
4646
sourceSets.create 'perf'
47-
project.dependencies.add 'perfCompile', sourceSets.getByName( 'main' ).output
48-
project.dependencies.add 'perfCompile', sourceSets.getByName( 'test' ).output
49-
project.dependencies.add 'perfCompile', project.configurations.getByName( 'testCompile' )
50-
project.dependencies.add 'perfRuntime', project.configurations.getByName( 'testRuntime' )
47+
project.dependencies.add 'perfImplementation', sourceSets.getByName( 'main' ).output
48+
project.dependencies.add 'perfImplementation', sourceSets.getByName( 'test' ).output
49+
project.dependencies.add 'perfImplementation', project.configurations.getByName( 'testImplementation' )
50+
project.dependencies.add 'perfRuntimeOnly', project.configurations.getByName( 'testRuntimeOnly' )
5151
project.tasks.getByName( LifecycleBasePlugin.CHECK_TASK_NAME ).dependsOn 'compilePerfJava'
5252
project.tasks.create( TaskNames.PERFORMANCE_TEST, Test, { Test task ->
5353
task.group = TaskGroups.PERFORMANCE

‎core/api/build.gradle‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ apply plugin: 'polygene-core'
2323
jar { manifest { name = "Apache Polygene™ Core API" } }
2424

2525
dependencies {
26-
testCompile polygene.core.testsupport
27-
testCompile polygene.library( 'constraints' )
28-
testCompile polygene.extension( 'valueserialization-orgjson' )
26+
testImplementation polygene.core.testsupport
27+
testImplementation polygene.library( 'constraints' )
28+
testImplementation polygene.extension( 'valueserialization-orgjson' )
2929

30-
testRuntime polygene.core.runtime
30+
testRuntimeOnly polygene.core.runtime
3131
}

‎core/bootstrap/build.gradle‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ apply plugin: 'polygene-core'
2323
jar { manifest { name = "Apache Polygene™ Core Bootstrap" } }
2424

2525
dependencies {
26-
compile polygene.core.spi
26+
api polygene.core.spi
2727

28-
testRuntime polygene.core.runtime
28+
testRuntimeOnly polygene.core.runtime
2929
}

‎core/runtime/build.gradle‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ jar { manifest { name = "Apache Polygene™ Core Runtime" } }
2525
dependencies {
2626
compileOnly libraries.osgi_core
2727

28-
compile polygene.core.bootstrap
29-
compile libraries.asm
30-
compile libraries.asm_util
31-
compile libraries.asm_commons
28+
api polygene.core.spi
3229

33-
testCompile polygene.core.testsupport
34-
testCompile polygene.library( 'constraints' )
30+
implementation polygene.core.bootstrap
31+
implementation libraries.asm
32+
implementation libraries.asm_util
33+
implementation libraries.asm_commons
34+
35+
testImplementation polygene.core.testsupport
36+
testImplementation polygene.library( 'constraints' )
3537
}

‎core/spi/build.gradle‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ apply plugin: 'polygene-core'
2323
jar { manifest { name = "Apache Polygene™ Core SPI" } }
2424

2525
dependencies {
26-
compile polygene.core.api
27-
compile libraries.org_json
26+
api polygene.core.api
27+
api libraries.org_json
2828

29-
testCompile polygene.core.testsupport
29+
testImplementation polygene.core.testsupport
3030

31-
testRuntime polygene.core.runtime
32-
testRuntime libraries.logback
31+
testRuntimeOnly polygene.core.runtime
32+
testRuntimeOnly libraries.logback
3333
}

‎core/testsupport/build.gradle‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ apply plugin: 'polygene-core'
2323
jar { manifest { name = "Apache Polygene™ Core Test Support" } }
2424

2525
dependencies {
26-
compile polygene.core.bootstrap
27-
compile libraries.junit
26+
api polygene.core.bootstrap
27+
api libraries.junit
2828

29-
testRuntime polygene.core.runtime
29+
testRuntimeOnly polygene.core.runtime
3030
}

‎extensions/cache-ehcache/build.gradle‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@ description = "Apache Polygene™ Ehcache Cache Extension"
2525
jar { manifest { name = "Apache Polygene™ Extension: EhCache" } }
2626

2727
dependencies {
28-
compile polygene.core.bootstrap
29-
compile polygene.library( 'constraints' )
30-
compile libraries.ehcache
28+
api polygene.core.bootstrap
3129

32-
runtime polygene.core.runtime
30+
implementation polygene.library( 'constraints' )
31+
implementation libraries.ehcache
3332

34-
testCompile polygene.core.testsupport
35-
testCompile polygene.extension( 'valueserialization-orgjson' )
33+
runtimeOnly polygene.core.runtime
3634

37-
testRuntime libraries.logback
35+
testImplementation polygene.core.testsupport
36+
testImplementation polygene.extension( 'valueserialization-orgjson' )
37+
38+
testRuntimeOnly libraries.logback
3839
}

‎extensions/cache-memcache/build.gradle‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@ description = "Apache Polygene™ Memcache Cache Extension"
2525
jar { manifest { name = "Apache Polygene™ Extension - Cache - Memcache" } }
2626

2727
dependencies {
28-
compile polygene.core.bootstrap
29-
compile libraries.spymemcached
28+
api polygene.core.bootstrap
3029

31-
runtime polygene.core.runtime
30+
implementation libraries.spymemcached
3231

33-
testCompile polygene.internals.testsupport
34-
testCompile polygene.extension( 'valueserialization-orgjson' )
32+
runtimeOnly polygene.core.runtime
3533

36-
testRuntime libraries.logback
34+
testImplementation polygene.internals.testsupport
35+
testImplementation polygene.extension( 'valueserialization-orgjson' )
36+
37+
testRuntimeOnly libraries.logback
3738
}

‎extensions/entitystore-cassandra/build.gradle‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,16 @@ description = "Apache Polygene™ Cassandra EntityStore Extension"
2525
jar { manifest { name = "Apache Polygene™ Extension - EntityStore - Cassandra" } }
2626

2727
dependencies {
28-
compile polygene.core.bootstrap
29-
compile polygene.library( 'locking' )
30-
compile libraries.cassandra_client
31-
compile libraries.jackson_mapper
28+
api polygene.core.bootstrap
29+
api libraries.cassandra_client
3230

33-
runtime polygene.core.runtime
31+
implementation polygene.library( 'locking' )
32+
implementation libraries.jackson_mapper
3433

35-
testCompile polygene.internals.testsupport
36-
testCompile polygene.extension( 'valueserialization-jackson' )
34+
runtimeOnly polygene.core.runtime
3735

38-
testRuntime libraries.logback
36+
testImplementation polygene.internals.testsupport
37+
testImplementation polygene.extension( 'valueserialization-jackson' )
38+
39+
testRuntimeOnly libraries.logback
3940
}

0 commit comments

Comments
 (0)