Skip to content

Commit e63c8a0

Browse files
committed
add endpoints-framework-all uberjar artifact
* endpoints-framework-all now has all transitive dependencies included in its JAR, repackaged to avoid dependency conflicts * endpoints-framework-guice no longer has endpoints-framework as a dependency, so that one can use the artifact with endpoints-framework or endpoints-framework-all. * endpoints-framework-guice has a small Preconditions class now so that it doesn't have to depend on Guava, which it previously was transitively. * POM URLs have been fixed to be the correct address.
1 parent 472085d commit e63c8a0

8 files changed

Lines changed: 75 additions & 7 deletions

File tree

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ def configureMaven(project, projectName, projectDescription) {
9797
url 'https://cloud.google.com/endpoints/docs/frameworks/java'
9898

9999
scm {
100-
connection 'scm:git:https://github.com/cloudendpoints/endpoints-java-framework'
101-
developerConnection 'scm:git:https://github.com/cloudendpoints/endpoints-java-framework'
102-
url 'scm:git:https://github.com/cloudendpoints/endpoints-java-framework'
100+
connection 'scm:git:https://github.com/cloudendpoints/endpoints-java'
101+
developerConnection 'scm:git:https://github.com/cloudendpoints/endpoints-java'
102+
url 'scm:git:https://github.com/cloudendpoints/endpoints-java'
103103
}
104104

105105
licenses {
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
plugins {
2+
id 'com.github.johnrengelman.shadow' version '1.2.3'
3+
}
4+
5+
configurations {
6+
include
7+
compile.extendsFrom include
8+
}
9+
10+
jar {
11+
from {
12+
configurations.include.collect { it.isDirectory() ? it : zipTree(it) }
13+
}
14+
}
15+
16+
def repackagedDir = 'endpoints.repackaged'
17+
18+
shadowJar {
19+
relocate 'org.apache', "${repackagedDir}.org.apache"
20+
relocate 'org.yaml', "${repackagedDir}.org.yaml"
21+
relocate 'org.joda', "${repackagedDir}.org.joda"
22+
relocate 'com.fasterxml', "${repackagedDir}.com.fasterxml"
23+
relocate 'io.swagger', "${repackagedDir}.io.swagger"
24+
relocate 'com.google.common', "${repackagedDir}.com.google.common"
25+
relocate 'com.google.api.client', "${repackagedDir}.com.google.api.client"
26+
relocate 'org.slf4j', "${repackagedDir}.org.slf4j"
27+
28+
dependencies {
29+
exclude(dependency('com.google.appengine:appengine-api-1.0-sdk:.*'))
30+
exclude(dependency('javax.servlet:servlet-api:.*'))
31+
}
32+
}
33+
34+
dependencies {
35+
include project(':endpoints-framework')
36+
compile group: 'com.google.appengine', name: 'appengine-api-1.0-sdk', version: appengineVersion
37+
compile group: 'javax.servlet', name: 'servlet-api', version: servletVersion
38+
}
39+
40+
configureMaven(project, 'Endpoints Framework', 'A framework for building RESTful web APIs.')

endpoints-framework-guice/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ configureMaven(
2020
'Extension to configure the Endpoints Framework via Guice.')
2121

2222
dependencies {
23-
compile project(':endpoints-framework')
23+
compileOnly project(':endpoints-framework')
2424
compile group: 'com.google.inject', name: 'guice', version: guiceVersion
2525
compile group: 'com.google.inject.extensions', name: 'guice-servlet', version: guiceVersion
2626

endpoints-framework-guice/src/main/java/com/google/api/server/spi/guice/GuiceEndpointsServlet.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
package com.google.api.server.spi.guice;
1717

1818
import com.google.api.server.spi.EndpointsServlet;
19-
import com.google.common.base.Preconditions;
2019
import com.google.inject.Inject;
2120
import com.google.inject.Singleton;
2221

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright 2017 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.google.api.server.spi.guice;
17+
18+
/**
19+
* Rather than shading all of Guava into an endpoints-framework-guice-all artifact, we include the
20+
* necessary functionality in this small helper class to remove the dependency.
21+
*/
22+
final class Preconditions {
23+
static <T> T checkNotNull(T ref, String errorMessage) {
24+
if (ref == null) {
25+
throw new NullPointerException(errorMessage);
26+
}
27+
return ref;
28+
}
29+
}

endpoints-framework-guice/src/main/java/com/google/api/server/spi/guice/ServiceMap.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package com.google.api.server.spi.guice;
1717

18-
import com.google.common.base.Preconditions;
1918
import com.google.inject.Binder;
2019

2120
import java.util.ArrayList;

endpoints-framework/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,4 @@ dependencies {
113113
testCompile group: 'org.springframework', name: 'spring-test', version: springtestVersion
114114
testCompile group: 'com.google.guava', name: 'guava-testlib', version: guavaVersion
115115
}
116+

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include ':endpoints-framework', ':endpoints-framework-tools', ':endpoints-framework-guice', ':test-utils', ':discovery-client', ':test-compat', ':test-compat:legacy-app', ':test-compat:new-app', ':test-compat:new-app-guice'
1+
include ':endpoints-framework', 'endpoints-framework-all', ':endpoints-framework-tools', ':endpoints-framework-guice', ':test-utils', ':discovery-client', ':test-compat', ':test-compat:legacy-app', ':test-compat:new-app', ':test-compat:new-app-guice'

0 commit comments

Comments
 (0)