Skip to content

Commit b8f70f9

Browse files
authored
Merge pull request #5 from UweTrottmann/fix-gradle-6
Fix Gradle 6
2 parents bbe0c8e + baed8da commit b8f70f9

12 files changed

Lines changed: 47 additions & 75 deletions

File tree

.github/workflows/gradle.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ jobs:
2727
uses: gradle/gradle-build-action@243af859f8ca30903d9d7f7936897ca0358ba691 # v2.7.1
2828

2929
- name: Execute Gradle build
30-
run: ./gradlew build -x :endpoints-management-control-appengine-all:build -x :endpoints-management-control-all:build
30+
# run: ./gradlew build -x :endpoints-management-control-appengine-all:build -x :endpoints-management-control-all:build
31+
run: ./gradlew build

build.gradle

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,18 @@
1717
allprojects {
1818
apply plugin: 'eclipse'
1919
apply plugin: 'jacoco'
20-
apply plugin: 'java'
20+
apply plugin: 'java-library'
2121
apply plugin: 'maven'
2222
apply plugin: 'signing'
2323

2424
group = 'com.google.endpoints'
2525

26+
java {
27+
toolchain {
28+
languageVersion = JavaLanguageVersion.of(8)
29+
}
30+
}
31+
2632
jacocoTestReport {
2733
reports {
2834
xml.enabled true
@@ -59,18 +65,6 @@ subprojects {
5965
mavenCentral()
6066
}
6167

62-
compileJava {
63-
// Workaround to actually apply project compatibility
64-
sourceCompatibility = project.sourceCompatibility
65-
targetCompatibility = project.targetCompatibility
66-
}
67-
68-
compileTestJava {
69-
// Workaround to actually apply project compatibility
70-
sourceCompatibility = project.sourceCompatibility
71-
targetCompatibility = project.targetCompatibility
72-
}
73-
7468
ext {
7569
libraries = [
7670
grpcBom: "io.grpc:grpc-bom:${grpcVersion}",

endpoints-auth/build.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,24 @@ configureMaven(
2222
archivesBaseName = 'endpoints-management-auth'
2323

2424
configurations {
25-
integrationTestCompile.extendsFrom testCompile
26-
integrationTestRuntime.extendsFrom testRuntime
25+
integrationTestCompile.extendsFrom testImplementation
26+
integrationTestRuntime.extendsFrom testRuntimeOnly
2727
}
2828

2929
dependencies {
3030
implementation project(":endpoints-service-config")
31-
implementation(project(":endpoints-control")) {
32-
transitive = false
31+
api(project(":endpoints-control")) {
32+
transitive = false // Just importing a model file (MethodRegistry.AuthInfo), do not pull in all dependencies.
3333
}
3434

3535
implementation "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
3636
implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
37-
implementation "com.google.guava:guava:${guavaVersion}"
37+
api "com.google.guava:guava:${guavaVersion}"
3838
implementation "com.google.flogger:flogger:${floggerVersion}"
3939
runtimeOnly "com.google.flogger:flogger-system-backend:${floggerVersion}"
40-
implementation "com.google.http-client:google-http-client:${httpClientVersion}"
41-
implementation "javax.servlet:servlet-api:${servletApiVersion}"
42-
implementation "org.bitbucket.b_c:jose4j:${jose4jVersion}"
40+
api "com.google.http-client:google-http-client:${httpClientVersion}"
41+
api "javax.servlet:servlet-api:${servletApiVersion}"
42+
api "org.bitbucket.b_c:jose4j:${jose4jVersion}"
4343

4444
testImplementation "junit:junit:${junitVersion}"
4545
testImplementation "org.bouncycastle:bcmail-jdk15on:${bouncycastleVersion}"

endpoints-control-api-client/build.gradle

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ dependencies {
3232
implementation("com.google.api-client:google-api-client-protobuf:${googleApiClientProtobufVersion}") {
3333
exclude group: 'com.google.guava', module: 'guava-jdk5'
3434
}
35-
implementation module(group: 'com.google.api-client', name: 'google-api-client', version: '1.22.0') {
36-
dependency('com.google.http-client:google-http-client:1.22.0')
37-
dependency('com.google.oauth-client:google-oauth-client:1.22.0')
35+
implementation("com.google.api-client:google-api-client:${googleApiClientProtobufVersion}") {
3836
exclude group: 'com.google.guava', module: 'guava-jdk5'
3937
}
40-
implementation project(":endpoints-management-protos")
38+
api("com.google.http-client:google-http-client:$httpClientVersion")
39+
api project(":endpoints-management-protos")
4140
}

endpoints-control-appengine/build.gradle

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,16 @@ configureMaven(
2222
archivesBaseName = 'endpoints-management-control-appengine'
2323

2424
dependencies {
25+
api project(":endpoints-control")
2526
implementation "com.google.appengine:appengine-api-1.0-sdk:$appengineSdkVersion"
26-
implementation "com.google.code.findbugs:jsr305:${jsr305Version}"
27-
implementation "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
2827
implementation "com.google.guava:guava:${guavaVersion}"
29-
implementation("com.google.http-client:google-http-client-jackson2:${httpClientVersion}") {
28+
implementation "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
29+
implementation("com.google.http-client:google-http-client:${httpClientVersion}") {
3030
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core'
3131
exclude group: 'com.google.guava', module: 'guava-jdk5'
3232
}
3333
implementation(group: 'com.google.api-client', name: 'google-api-client-appengine', version: "${googleApiClientAppEngineVersion}") {
3434
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core'
3535
exclude group: 'com.google.guava', module: 'guava-jdk5'
3636
}
37-
implementation project(":endpoints-control")
3837
}

endpoints-control/build.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,26 +50,26 @@ processResources {
5050
dependencies {
5151
implementation "com.google.auto.value:auto-value-annotations:${autoValueVersion}"
5252
annotationProcessor "com.google.auto.value:auto-value:${autoValueVersion}"
53-
implementation "com.google.code.findbugs:jsr305:${jsr305Version}"
54-
implementation "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
53+
api "com.google.code.findbugs:jsr305:${jsr305Version}"
5554
implementation "com.google.flogger:flogger:${floggerVersion}"
5655
runtimeOnly "com.google.flogger:flogger-system-backend:${floggerVersion}"
57-
implementation "com.google.guava:guava:${guavaVersion}"
56+
api "com.google.guava:guava:${guavaVersion}"
57+
implementation "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
5858
implementation("com.google.http-client:google-http-client-jackson2:${httpClientVersion}") {
5959
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core'
6060
exclude group: 'com.google.guava', module: 'guava-jdk5'
6161
}
62-
implementation "javax.servlet:servlet-api:${servletApiVersion}"
63-
implementation "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
64-
implementation(group: 'com.google.api-client', name: 'google-api-client-appengine', version: "${googleApiClientAppEngineVersion}") {
62+
implementation("com.google.api-client:google-api-client:${googleApiClientProtobufVersion}") {
6563
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core'
6664
exclude group: 'com.google.guava', module: 'guava-jdk5'
6765
}
68-
implementation project(":endpoints-control-api-client")
66+
api "javax.servlet:servlet-api:${servletApiVersion}"
67+
api project(":endpoints-control-api-client")
6968
implementation project(":endpoints-service-config")
70-
implementation project(":endpoints-management-protos")
69+
api project(":endpoints-management-protos")
7170

7271
testImplementation "junit:junit:${junitVersion}"
7372
testImplementation "com.google.truth:truth:${truthVersion}"
7473
testImplementation "org.mockito:mockito-core:${mockitoVersion}"
74+
testImplementation "com.google.protobuf:protobuf-java-util"
7575
}

endpoints-control/src/main/java/com/google/api/control/Client.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -684,18 +684,18 @@ public String toString() {
684684
/**
685685
* SchedulerFactory defines a method for creating {@link Scheduler} instances
686686
*/
687-
interface SchedulerFactory {
687+
public interface SchedulerFactory {
688688
/**
689689
* @param ticker obtains time updates from a time source.
690-
* @return a {@ link Scheduler}
690+
* @return a {@link Scheduler}
691691
*/
692692
Scheduler create(Ticker ticker);
693693
}
694694

695695
/**
696696
* Scheduler uses a {@code PriorityQueue} to maintain a series of {@link Runnable}
697697
*/
698-
static class Scheduler {
698+
public static class Scheduler {
699699
private PriorityQueue<ScheduledEvent> queue;
700700
private Ticker ticker;
701701
private Statistics statistics;

endpoints-framework-auth/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ configureMaven(
2222
archivesBaseName = "endpoints-framework-auth"
2323

2424
dependencies {
25-
compileOnly group: "com.google.endpoints", name: "endpoints-framework", version: "${endpointsFrameworkVersion}"
25+
api group: "com.google.endpoints", name: "endpoints-framework", version: "${endpointsFrameworkVersion}"
26+
api "javax.servlet:servlet-api:${servletApiVersion}"
2627
implementation project(":endpoints-auth")
28+
implementation project(":endpoints-control")
2729

2830
testImplementation group: "junit", name: "junit", version: "${junitVersion}"
2931
testImplementation group: "org.mockito", name: "mockito-core", version: "${mockitoVersion}"

endpoints-management-protos/build.gradle

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,26 @@ buildscript {
55
dependencies { classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.10' }
66
}
77

8-
apply plugin: 'java'
8+
apply plugin: 'java-library'
99
apply plugin: 'maven'
1010
apply plugin: 'signing'
1111
apply plugin: 'com.google.protobuf'
1212

1313
description = 'GRPC library for the servicecontrol-v1 service'
1414
// TODO: use a flag to determine whether to produce a release or a snapshot
15-
sourceCompatibility = 1.8
16-
targetCompatibility = 1.8
1715

1816
repositories {
1917
mavenCentral()
2018
mavenLocal()
2119
}
2220

2321
dependencies {
24-
implementation platform(libraries.protobufJavaBom),
25-
libraries.protobufJava
22+
api platform(libraries.protobufJavaBom)
23+
api libraries.protobufJava
2624

27-
implementation platform(libraries.grpcBom),
28-
libraries.grpcStub,
29-
libraries.grpcProtobuf
25+
api platform(libraries.grpcBom)
26+
api libraries.grpcStub
27+
api libraries.grpcProtobuf
3028
}
3129

3230
protobuf {

endpoints-service-config/build.gradle

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ configureMaven(
2222
archivesBaseName = 'endpoints-management-config'
2323

2424
dependencies {
25-
implementation(project(":endpoints-management-protos"))
26-
implementation platform(libraries.protobufJavaBom)
27-
implementation "com.google.protobuf:protobuf-java"
25+
api(project(":endpoints-management-protos"))
2826
implementation "com.google.apis:google-api-services-servicemanagement:$servicemanagementVersion"
2927
compileOnly "com.google.appengine:appengine-api-1.0-sdk:$appengineSdkVersion"
30-
implementation "com.google.guava:guava:$guavaVersion"
28+
api "com.google.guava:guava:$guavaVersion"
3129
implementation "com.google.http-client:google-http-client:$httpClientVersion"
3230
implementation "com.google.protobuf:protobuf-java-util"
3331

0 commit comments

Comments
 (0)