Skip to content
This repository was archived by the owner on May 28, 2018. It is now read-only.

Commit e0f2002

Browse files
Michal GajdošGerrit Code Review
authored andcommitted
Merge "Fix for JERSEY-2420: jersey-guava-2.x-sources.jar is empty"
2 parents 16f8b8a + 593b457 commit e0f2002

File tree

2 files changed

+56
-13
lines changed

2 files changed

+56
-13
lines changed

bundles/repackaged/jersey-guava/build.gradle

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,30 @@ task generateProGuardConfig << {
8888
conf << ("-keep public class ${it}${ln}")
8989
conf << ("-keepclassmembers public class ${it} { *; }${ln}")
9090
}
91-
}
91+
}
92+
93+
task copyShadedJar(type: Copy) {
94+
def version = project.hasProperty('jerseyVersion') ? jerseyVersion : ''
95+
from ('target') {
96+
include 'jersey-guava-' + version + '-shaded-sources.jar'
97+
}
98+
into 'target'
99+
100+
rename {
101+
String fileName -> fileName.replace('shaded-sources', 'sources')
102+
}
103+
}
104+
105+
task deleteShadedJar(type: Delete) {
106+
def version = project.hasProperty('jerseyVersion') ? jerseyVersion : ''
107+
delete ('target/jersey-guava-' + version + '-shaded-sources.jar')
108+
}
109+
110+
task renameShadedJar(dependsOn: ['copyShadedJar', 'deleteShadedJar'])
111+
deleteShadedJar.mustRunAfter copyShadedJar
112+
113+
copyShadedJar.onlyIf {project.hasProperty('jerseyVersion')}
114+
deleteShadedJar.onlyIf {project.hasProperty('jerseyVersion')}
115+
renameShadedJar.onlyIf {project.hasProperty('jerseyVersion')}
116+
generateProGuardConfig.onlyIf {!project.hasProperty('jerseyVersion')}
117+

bundles/repackaged/jersey-guava/pom.xml

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
holder.
4141
4242
-->
43-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
43+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4445

4546
<modelVersion>4.0.0</modelVersion>
4647

@@ -153,23 +154,39 @@
153154
<plugin>
154155
<groupId>org.fortasoft</groupId>
155156
<artifactId>gradle-maven-plugin</artifactId>
156-
<configuration>
157-
<tasks>
158-
<task>generateProGuardConfig</task>
159-
</tasks>
160-
<args>
161-
<arg>-q</arg>
162-
<arg>-PshadedPackage=${shade.package}</arg>
163-
<arg>-PabsolutePath=${project.parent.parent.parent.basedir}</arg>
164-
<arg>-PconfFile=${project.build.directory}/proguard.conf</arg>
165-
</args>
166-
</configuration>
167157
<executions>
168158
<execution>
159+
<id>proguard</id>
169160
<phase>package</phase>
170161
<goals>
171162
<goal>invoke</goal>
172163
</goals>
164+
<configuration>
165+
<tasks>
166+
<task>generateProGuardConfig</task>
167+
</tasks>
168+
<args>
169+
<arg>-q</arg>
170+
<arg>-PshadedPackage=${shade.package}</arg>
171+
<arg>-PabsolutePath=${project.parent.parent.parent.basedir}</arg>
172+
<arg>-PconfFile=${project.build.directory}/proguard.conf</arg>
173+
</args>
174+
</configuration>
175+
</execution>
176+
<execution>
177+
<id>renameShaddedJar</id>
178+
<phase>verify</phase>
179+
<goals>
180+
<goal>invoke</goal>
181+
</goals>
182+
<configuration>
183+
<tasks>
184+
<task>renameShadedJar</task>
185+
</tasks>
186+
<args>
187+
<arg>-PjerseyVersion=${jersey.version}</arg>
188+
</args>
189+
</configuration>
173190
</execution>
174191
</executions>
175192
</plugin>

0 commit comments

Comments
 (0)