Skip to content

Commit

Permalink
Update gradle to 7.1.1 (#954)
Browse files Browse the repository at this point in the history
* gradle update to 7.1.1

* Update testing/src/main/java/com/github/bsideup/liiklus/container/LiiklusContainer.java

* publications
  • Loading branch information
lanwen committed Jul 22, 2021
1 parent a52eb2c commit 9342b29
Show file tree
Hide file tree
Showing 26 changed files with 259 additions and 147 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
Expand Down
14 changes: 11 additions & 3 deletions api/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
plugins {
id 'java-library'
}

sourceCompatibility = targetCompatibility = 8

java {
withSourcesJar()
}

dependencies {
compile 'org.reactivestreams:reactive-streams'
compile 'io.cloudevents:cloudevents-api:1.2.0'
api 'org.reactivestreams:reactive-streams'
api 'io.cloudevents:cloudevents-api:1.2.0'

testCompile 'org.assertj:assertj-core'
testImplementation 'org.assertj:assertj-core'
}
27 changes: 17 additions & 10 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
apply plugin: 'org.springframework.boot'
plugins {
id 'java-library'
id 'org.springframework.boot'
}

java {
withSourcesJar()
}

jar {
enabled = true
Expand All @@ -9,18 +16,18 @@ bootJar {
}

dependencies {
compile project(":api")
compile project(":protocol")
api project(":api")
api project(":protocol")

compile 'org.springframework.boot:spring-boot-starter-webflux'
compile 'org.springframework.fu:spring-fu-jafu'
api 'org.springframework.boot:spring-boot-starter-webflux'
api 'org.springframework.fu:spring-fu-jafu'

compile 'org.pf4j:pf4j'
api 'org.pf4j:pf4j'

testCompile 'org.springframework.boot:spring-boot-starter-test'
testCompile 'org.assertj:assertj-core'
testCompile 'org.awaitility:awaitility'
testCompile project(":client")
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.awaitility:awaitility'
testImplementation project(":client")
}

def plugins = rootProject.allprojects.findAll { it.projectDir.parentFile.name == "plugins" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public ClassLoader loadPlugin(Path pluginPath, PluginDescriptor pluginDescriptor
pluginClassLoader.addFile(pluginPath.toFile());

// TODO consider fat jars
try (var jarFileSystem = FileSystems.newFileSystem(pluginPath, null)) {
try (var jarFileSystem = FileSystems.newFileSystem(pluginPath, (ClassLoader) null)) {
var libPath = jarFileSystem.getPath("lib");
if (Files.exists(libPath)) {
try (var pathStream = Files.walk(libPath, 1)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private static Envelope toEnvelope(PublishRequest request) {
var cloudEvent = request.getLiiklusEvent();

String time = null;
if (!StringUtils.isEmpty(cloudEvent.getTime())) {
if (StringUtils.hasText(cloudEvent.getTime())) {
time = cloudEvent.getTime();
}

Expand Down
37 changes: 33 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.2.9.RELEASE")
Expand All @@ -9,12 +10,13 @@ buildscript {

plugins {
id 'io.franzbecker.gradle-lombok' version '4.0.0' apply false
id "com.google.protobuf" version "0.8.10" apply false
id "com.google.protobuf" version "0.8.16" apply false
}

allprojects {
repositories {
jcenter()
mavenCentral()
maven { url "https://repo.spring.io/milestone" }
maven { url 'https://jitpack.io' }
}
Expand All @@ -35,7 +37,7 @@ allprojects {
configure(subprojects.findAll { !it.name.startsWith("examples/") }) {
apply plugin: 'io.spring.dependency-management'
apply plugin: 'io.franzbecker.gradle-lombok'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'java'
apply from: "$rootDir/gradle/rerunTests.gradle"

Expand Down Expand Up @@ -73,8 +75,26 @@ configure(subprojects.findAll { !it.name.startsWith("examples/") }) {
}
}

project.afterEvaluate {
project.tasks.findByName("install")?.dependsOn(tasks.findByName("assemble"))
publishing {
publications {
maven(MavenPublication) {
from components.java

versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
}
}
}

task install {
dependsOn tasks.publishToMavenLocal
dependsOn tasks.findByName("assemble")
}

dependencyManagement {
Expand Down Expand Up @@ -119,4 +139,13 @@ configure(subprojects.findAll { !it.name.startsWith("examples/") }) {
testImplementation 'org.junit.jupiter:junit-jupiter'
}

configurations {
compileOnlyClasspath {
// https://discuss.gradle.org/t/what-is-a-configuration-which-cant-be-directly-resolved/30721
extendsFrom compileOnly
canBeConsumed false
canBeResolved true
}
}

}
28 changes: 16 additions & 12 deletions client/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
plugins {
id "idea"
id 'idea'
id 'java-library'
id 'com.google.protobuf'
}

apply plugin: "com.google.protobuf"

protobuf {
protoc {
artifact = 'com.google.protobuf:protoc'
Expand All @@ -17,7 +17,7 @@ protobuf {
}

reactor {
artifact = "com.salesforce.servicelibs:reactor-grpc:0.9.0:jdk8@jar"
artifact = 'com.salesforce.servicelibs:reactor-grpc:0.9.0:jdk8@jar'
}

rsocketRpc {
Expand All @@ -43,6 +43,10 @@ clean {
delete protobuf.generatedFilesBaseDir
}

java {
withSourcesJar()
}

idea {
module {
generatedSourceDirs += file("${protobuf.generatedFilesBaseDir}/main/java")
Expand All @@ -56,14 +60,14 @@ sourceCompatibility = targetCompatibility = 8

dependencies {
protobuf project(":protocol")
compile project(":protocol")
api project(":protocol")

compile 'io.grpc:grpc-stub'
compile 'io.grpc:grpc-protobuf'
compile 'com.salesforce.servicelibs:reactor-grpc-stub'
compile 'io.rsocket.rpc:rsocket-rpc-core'
api 'io.grpc:grpc-stub'
api 'io.grpc:grpc-protobuf'
api 'com.salesforce.servicelibs:reactor-grpc-stub'
api 'io.rsocket.rpc:rsocket-rpc-core'

compile 'io.rsocket:rsocket-transport-netty'
compile 'io.grpc:grpc-netty'
compile 'com.google.protobuf:protobuf-java-util'
api 'io.rsocket:rsocket-transport-netty'
api 'io.grpc:grpc-netty'
api 'com.google.protobuf:protobuf-java-util'
}
22 changes: 11 additions & 11 deletions examples/java/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id "java"
id "idea"
id "com.google.protobuf"
id 'java'
id 'idea'
id 'com.google.protobuf'
id 'io.franzbecker.gradle-lombok'
}

Expand Down Expand Up @@ -43,19 +43,19 @@ idea {
}

repositories {
jcenter()
mavenCentral()
}

dependencies {
compile 'org.testcontainers:kafka:1.15.3'
implementation 'org.testcontainers:kafka:1.15.3'

compile 'org.apache.commons:commons-math3:3.6.1'
implementation 'org.apache.commons:commons-math3:3.6.1'

compile 'com.google.protobuf:protobuf-java:3.10.0'
implementation 'com.google.protobuf:protobuf-java:3.10.0'

compile 'io.grpc:grpc-netty:1.24.1'
compile 'io.grpc:grpc-protobuf:1.24.1'
compile 'com.salesforce.servicelibs:reactor-grpc-stub:0.10.0'
implementation 'io.grpc:grpc-netty:1.24.1'
implementation 'io.grpc:grpc-protobuf:1.24.1'
implementation 'com.salesforce.servicelibs:reactor-grpc-stub:0.10.0'

runtime 'ch.qos.logback:logback-classic:1.2.3'
runtimeOnly 'ch.qos.logback:logback-classic:1.2.3'
}
40 changes: 26 additions & 14 deletions examples/plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
plugins {
id "java"
id "io.spring.dependency-management"
id 'java-library'
id 'io.spring.dependency-management'
id 'io.franzbecker.gradle-lombok'
}

sourceCompatibility = targetCompatibility = 8

jar {
baseName = "example-plugin"
archiveBaseName = "example-plugin"
manifest {
attributes(
'Plugin-Id': "example-plugin",
Expand All @@ -16,17 +16,29 @@ jar {
}

into('lib') {
from configurations.compile
from configurations.runtimeClasspath - configurations.compileOnlyClasspath
}
}

sourceSets.test.resources.srcDir jar.outputs.files.singleFile.parentFile
test {
dependsOn jar
configurations {
compileOnlyClasspath {
extendsFrom compileOnly
canBeConsumed false
canBeResolved true
}
}

processTestResources.dependsOn(jar)
test.dependsOn(jar)

sourceSets {
test {
resources.srcDir jar.outputs.files.singleFile.parentFile
}
}

repositories {
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
}

Expand Down Expand Up @@ -57,11 +69,11 @@ dependencies {
compileOnly 'org.springframework.boot:spring-boot-starter'
compileOnly 'io.projectreactor:reactor-core'

compile 'org.apache.commons:commons-lang3:3.9'
implementation 'org.apache.commons:commons-lang3:3.9'

testCompile 'org.testcontainers:kafka'
testCompile 'ch.qos.logback:logback-classic:'
testCompile "com.github.bsideup.liiklus:client"
testCompile "com.github.bsideup.liiklus:testing"
testCompile 'org.assertj:assertj-core'
testImplementation 'org.testcontainers:kafka'
testImplementation 'ch.qos.logback:logback-classic:'
testImplementation "com.github.bsideup.liiklus:client"
testImplementation "com.github.bsideup.liiklus:testing"
testImplementation 'org.assertj:assertj-core'
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\:https://services.gradle.org/distributions/gradle-6.3-all.zip
distributionUrl=https\:https://services.gradle.org/distributions/gradle-7.1.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
16 changes: 10 additions & 6 deletions plugins/dynamodb-positions-storage/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
id 'java-library'
}

jar {
manifest {
attributes(
Expand All @@ -7,7 +11,7 @@ jar {
}

into('lib') {
from(configurations.compile - configurations.compileOnly)
from(configurations.runtimeClasspath - configurations.compileOnlyClasspath)
}
}

Expand All @@ -22,10 +26,10 @@ dependencies {

compileOnly project(":app")

compile 'software.amazon.awssdk:dynamodb:2.3.0'
api 'software.amazon.awssdk:dynamodb:2.3.0'

testCompile project(":tck")
testCompile 'org.springframework.boot:spring-boot-test'
testCompile 'org.testcontainers:localstack'
testCompile 'com.amazonaws:aws-java-sdk-dynamodb:1.11.475'
testImplementation project(":tck")
testImplementation 'org.springframework.boot:spring-boot-test'
testImplementation 'org.testcontainers:localstack'
testImplementation 'com.amazonaws:aws-java-sdk-dynamodb:1.11.475'
}
Loading

0 comments on commit 9342b29

Please sign in to comment.