Skip to content

Commit 366f0d7

Browse files
committed
Generate -sources and -javadoc jars
Each spring-* subproject now has sourcesJar and javadocJar tasks - Ignore subproject overview.html files for now (not all have one) - Ensure @author attribution occurs - Javadoc 'header' is project description spring-asm is a special case - source jar is created, but empty (to comply with entry rules for Maven Central) - add package-info.java explaining the nature of spring-asm this is nice, because it shows up in the public API docs now. - add SpringAsmInfo in the org.springframework.asm package as a placeholder allowing the generation of javadocs (see link to bug) - add explicit 'repackageAsm' Gradle task allowing for easy testing and merging of jar containing bundlor manifest as well as jar containing repackaged ASM classes.
1 parent 2bab8f3 commit 366f0d7

9 files changed

Lines changed: 108 additions & 37 deletions

File tree

build.gradle

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,70 @@ configure(subprojects) {
5353
expand(copyright: new Date().format('yyyy'), version: project.version)
5454
}
5555
}
56-
}
5756

58-
configure(subprojects - project(":spring-asm")) {
57+
javadoc {
58+
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
59+
options.author = true
60+
options.header = project.name
61+
//options.overview = "${projectDir}/src/main/java/overview.html"
62+
}
5963

6064
task sourcesJar(type: Jar, dependsOn:classes) {
6165
classifier = 'sources'
62-
from sourceSets.main.allSource
66+
from sourceSets.main.allJava
67+
}
68+
69+
task javadocJar(type: Jar) {
70+
classifier = 'javadoc'
71+
from javadoc
6372
}
6473

6574
artifacts {
6675
archives sourcesJar
76+
archives javadocJar
6777
}
6878
}
6979

7080

81+
project("spring-asm") {
82+
description = 'Spring ASM'
83+
asmVersion = '2.2.3'
84+
85+
configurations {
86+
asm
87+
jarjar
88+
}
89+
dependencies {
90+
asm "asm:asm:${asmVersion}@jar", "asm:asm-commons:${asmVersion}@jar"
91+
jarjar 'com.googlecode.jarjar:jarjar:1.1'
92+
}
93+
94+
task repackageAsm(type: Jar) { jar ->
95+
jar.baseName = "asm-repack"
96+
jar.version = asmVersion
97+
98+
doLast() {
99+
project.ant {
100+
taskdef name: "jarjar", classname: "com.tonicsystems.jarjar.JarJarTask",
101+
classpath: configurations.jarjar.asPath
102+
jarjar(destfile: archivePath, index: "true", filesetmanifest: "merge") {
103+
configurations.asm.each { jarfile ->
104+
zipfileset(src: jarfile)
105+
}
106+
rule(pattern: 'org.objectweb.asm.**', result: 'org.springframework.asm.@1')
107+
}
108+
}
109+
}
110+
}
111+
112+
jar {
113+
dependsOn repackageAsm
114+
from(zipTree(repackageAsm.archivePath)) {
115+
exclude 'META-INF/INDEX.LIST'
116+
}
117+
}
118+
}
119+
71120
project('spring-core') {
72121
description = 'Spring Core'
73122
dependencies {
@@ -374,8 +423,8 @@ project('spring-struts') {
374423
project('spring-aspects') {
375424
description = 'Spring Aspects'
376425
apply from: 'aspectJ.gradle'
377-
compileJava.dependsOn project(":spring-orm").jar
378426
dependencies {
427+
compile project(":spring-orm")
379428
aspects project(":spring-orm")
380429
ajc "org.aspectj:aspectjtools:1.6.8"
381430
compile "org.aspectj:aspectjrt:1.6.8"

org.springframework.asm/build.gradle

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright 2002-2012 the original author or authors.
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+
17+
package org.springframework.asm;
18+
19+
/**
20+
* Placeholder to allow Javadoc generation. Required because
21+
* <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4492654">this bug</a>
22+
* does not allow the generation of Javadoc for packages having only a
23+
* {@code package-info.java} file.
24+
* <p>See <a href="package-summary.html">package-level Javadoc</a> for more
25+
* information on {@code org.springframework.asm}.
26+
*
27+
* @author Chris Beams
28+
* @since 3.2
29+
*/
30+
public final class SpringAsmInfo {
31+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Spring's repackaging of {@code org.objectweb.asm.*} (for internal use only).
3+
* <p>This repackaging technique avoids any potential conflicts with
4+
* dependencies on ASM at the application level or from other third-party
5+
* libraries and frameworks.
6+
* <p>As this repackaging happens at the classfile level, sources and Javadoc
7+
* are not available here. See the original ObjectWeb
8+
* <a href="http://asm.ow2.org/asm223/javadoc/user">ASM 2.2.3 Javadoc</a>
9+
* for details when working with these classes.
10+
*/
11+
package org.springframework.asm;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<html>
22
<body>
33
<p>
4-
The Spring Data Binding framework, an internal library used by Spring Web Flow.
4+
Spring's AspectJ-based aspects.
55
</p>
66
</body>
7-
</html>
7+
</html>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<html>
22
<body>
33
<p>
4-
The Spring Data Binding framework, an internal library used by Spring Web Flow.
4+
Spring's instrumentation agent for Tomcat.
55
</p>
66
</body>
7-
</html>
7+
</html>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<html>
22
<body>
33
<p>
4-
Spring's test context framework. Also includes common Servlet and Portlet API mocks.
4+
Spring's TestContext framework. Also includes common Servlet and Portlet API mocks.
55
</p>
66
</body>
7-
</html>
7+
</html>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<html>
22
<body>
33
<p>
4-
Spring's MVC framework in its Servlet API version. Includes support for common view technologies.
4+
Spring's MVC framework in its Servlet API version. Includes support for common view technologies.
55
</p>
66
</body>
7-
</html>
7+
</html>

src/api/overview.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<html>
2-
<body>
3-
This is the public API documentation for the <a href="http://github.com/SpringSource/spring-framework" target="_top">Spring Framework</a>.
4-
</body>
2+
<body>
3+
<p>
4+
This is the public API documentation for the <a href="http://github.com/SpringSource/spring-framework" target="_top">Spring Framework</a>.
5+
</p>
6+
</body>
57
</html>

0 commit comments

Comments
 (0)