Skip to content
This repository was archived by the owner on Apr 5, 2022. It is now read-only.

Commit 25fa7fd

Browse files
committed
Converted to new submodule-free build
1 parent 34839fd commit 25fa7fd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+617
-297
lines changed

.gitmodules

-3
This file was deleted.

docs/src/info/license.txt LICENSE

File renamed without changes.

NOTICE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
==========================================================================
2+
== NOTICE file corresponding to section 4 d of the Apache License, ==
3+
== Version 2.0, in this case for the Spring Social GitHub distribution. ==
4+
==========================================================================
5+
6+
This product includes software developed by
7+
the Apache Software Foundation (http://www.apache.org).
8+
9+
The end-user documentation included with a redistribution, if any,
10+
must include the following acknowledgement:
11+
12+
"This product includes software developed by the Spring Framework
13+
Project (http://www.springframework.org)."
14+
15+
Alternatively, this acknowledgement may appear in the software itself,
16+
if and wherever such third-party acknowledgements normally appear.
17+
18+
The names "Spring", "Spring Framework", and "Spring Social" must
19+
not be used to endorse or promote products derived from this software
20+
without prior written permission. For written permission, please contact
21+

build.gradle

+214-118
Original file line numberDiff line numberDiff line change
@@ -1,137 +1,92 @@
1-
/*
2-
* Copyright 2010 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-
import org.springframework.build.Version
17-
18-
// -----------------------------------------------------------------------------
19-
// Main gradle build file for Spring Social GitHub
20-
// @author Chris Beams
21-
// @author Craig Walls
22-
// -----------------------------------------------------------------------------
23-
24-
// -----------------------------------------------------------------------------
25-
// Configuration for the root project
26-
// -----------------------------------------------------------------------------
27-
description = 'Spring Social GitHub'
28-
abbreviation = 'SOCIAL-GITHUB'
29-
30-
apply plugin: 'base'
31-
apply plugin: 'idea'
32-
33-
def buildSrcDir = "$rootDir/buildSrc"
34-
apply from: "$buildSrcDir/wrapper.gradle"
35-
apply from: "$buildSrcDir/maven-root-pom.gradle"
36-
37-
// -----------------------------------------------------------------------------
38-
// Configuration for all projects including this one (the root project)
39-
//
40-
// @see settings.gradle for list of all subprojects
41-
// -----------------------------------------------------------------------------
42-
allprojects {
43-
// group will translate to groupId during pom generation and deployment
44-
group = 'org.springframework.social'
45-
46-
// version will be used in maven pom generation as well as determining
47-
// where artifacts should be deployed, based on release type of snapshot,
48-
// milestone or release.
49-
// @see org.springframework.build.Version under buildSrc/ for more info
50-
// @see gradle.properties for the declaration of this property.
51-
version = new Version(springSocialGitHubVersion)
52-
53-
// default set of maven repositories to be used when resolving dependencies
1+
buildscript {
542
repositories {
55-
mavenRepo urls: 'http://maven.springframework.org/release'
56-
mavenRepo urls: 'http://maven.springframework.org/milestone'
57-
mavenRepo urls: 'http://maven.springframework.org/snapshot'
58-
mavenCentral()
3+
maven { url 'http://repo.springsource.org/plugins-release' }
4+
}
5+
dependencies {
6+
classpath 'org.springframework.build.gradle:docbook-reference-plugin:0.1.3'
597
}
608
}
619

10+
configure(allprojects) {
11+
apply plugin: 'java'
12+
apply plugin: 'eclipse'
13+
apply plugin: 'idea'
6214

63-
// -----------------------------------------------------------------------------
64-
// Create collections of subprojects - each will receive their own configuration
65-
// - all subprojects that start with spring-social-* are 'java projects'
66-
// - documentation-related subprojects are not collected here
67-
//
68-
// @see configure(*) sections below
69-
// -----------------------------------------------------------------------------
70-
71-
javaprojects = subprojects.findAll { project ->
72-
project.path.startsWith(':spring-social-')
73-
}
74-
75-
// -----------------------------------------------------------------------------
76-
// Configuration for all java subprojects
77-
// -----------------------------------------------------------------------------
78-
configure(javaprojects) {
79-
80-
apply plugin: 'java' // tasks for conventional java lifecycle
81-
apply plugin: 'maven' // `gradle install` to push jars to local .m2 cache
82-
apply plugin: 'eclipse' // `gradle eclipse` to generate .classpath/.project
83-
apply plugin: 'idea' // `gradle idea` to generate .ipr/.iml
84-
85-
// set up dedicated directories for jars and source jars.
86-
// this makes it easier when putting together the distribution
87-
libsBinDir = new File(libsDir, 'bin')
88-
libsSrcDir = new File(libsDir, 'src')
89-
90-
// add tasks for creating source jars and generating poms etc
91-
apply from: "$buildSrcDir/maven-deployment.gradle"
15+
group = 'org.springframework.social'
9216

93-
// add tasks for finding and publishing .xsd files
94-
apply from: "$buildSrcDir/schema-publication.gradle"
17+
sourceCompatibility=1.5
18+
targetCompatibility=1.5
9519

96-
springSocialVersion = '1.0.0.BUILD-SNAPSHOT'
20+
springSocialVersion = '1.0.0.BUILD-SNAPSHOT'
9721
jacksonVersion = '1.9.2'
9822
junitVersion = '4.8.2'
9923
mockitoVersion = '1.8.5'
10024
springVersion = '3.1.0.RELEASE'
10125

102-
sourceSets {
103-
main {
104-
resources {
105-
srcDirs = ['src/main/java']
106-
}
107-
}
108-
test {
109-
resources {
110-
srcDirs = ['src/test/java']
111-
}
112-
}
26+
[compileJava, compileTestJava]*.options*.compilerArgs = ['-Xlint:none']
27+
28+
sourceSets.test.resources.srcDirs = ['src/test/resources', 'src/test/java']
29+
30+
test.systemProperty("java.awt.headless", "true")
31+
32+
repositories {
33+
maven { url "http://repo.springsource.org/libs-release" }
34+
maven { url "http://repo.springsource.org/libs-milestone" }
35+
maven { url "http://repo.springsource.org/libs-snapshot" }
36+
maven { url "http://repo.springsource.org/ebr-maven-external" }
11337
}
11438

115-
// dependencies that are common across all java projects
11639
dependencies {
11740
testCompile "junit:junit:$junitVersion"
11841
testCompile "org.mockito:mockito-all:$mockitoVersion"
11942
testCompile "org.springframework:spring-test:$springVersion"
12043
}
12144

122-
// enable all compiler warnings (GRADLE-1077)
123-
[compileJava, compileTestJava]*.options*.compilerArgs = ['-Xlint:all']
124-
125-
// generate .classpath files without GRADLE_CACHE variable (GRADLE-1079)
126-
eclipseClasspath.variables = [:]
45+
// servlet-api (2.5) and tomcat-servlet-api (3.0) classpath entries should not be
46+
// exported to dependent projects in Eclipse to avoid false compilation errors due
47+
// to changing APIs across these versions
48+
eclipse.classpath.file.whenMerged { classpath ->
49+
classpath.entries.findAll { entry -> entry.path.contains('servlet-api') }*.exported = false
50+
}
12751
}
12852

53+
configure(subprojects) { subproject ->
54+
apply from: "${rootProject.projectDir}/publish-maven.gradle"
55+
56+
jar {
57+
manifest.attributes['Implementation-Title'] = subproject.name
58+
manifest.attributes['Implementation-Version'] = subproject.version
59+
60+
from("${rootProject.projectDir}/src/dist") {
61+
include "license.txt"
62+
include "notice.txt"
63+
into "META-INF"
64+
expand(copyright: new Date().format('yyyy'), version: project.version)
65+
}
66+
}
12967

130-
// -----------------------------------------------------------------------------
131-
// Configuration for each individual core java subproject
132-
//
133-
// @see configure(javaprojects) above for general config
134-
// -----------------------------------------------------------------------------
68+
javadoc {
69+
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
70+
options.author = true
71+
options.header = project.name
72+
//options.overview = "${projectDir}/src/main/java/overview.html"
73+
}
74+
75+
task sourcesJar(type: Jar, dependsOn:classes) {
76+
classifier = 'sources'
77+
from sourceSets.main.allJava
78+
}
79+
80+
task javadocJar(type: Jar) {
81+
classifier = 'javadoc'
82+
from javadoc
83+
}
84+
85+
artifacts {
86+
archives sourcesJar
87+
archives javadocJar
88+
}
89+
}
13590

13691
project('spring-social-github') {
13792
description = 'Github API'
@@ -142,12 +97,153 @@ project('spring-social-github') {
14297
}
14398
}
14499

145-
// -----------------------------------------------------------------------------
146-
// Configuration for the docs subproject
147-
// -----------------------------------------------------------------------------
148-
project('docs') {
149-
apply from: "$buildSrcDir/docs.gradle"
100+
configure(rootProject) {
101+
description = 'Spring Social GitHub'
102+
103+
apply plugin: 'docbook-reference'
104+
105+
reference {
106+
sourceDir = file('src/reference/docbook')
107+
}
108+
109+
// don't publish the default jar for the root project
110+
configurations.archives.artifacts.clear()
111+
112+
dependencies { // for integration tests
113+
}
114+
115+
task api(type: Javadoc) {
116+
group = 'Documentation'
117+
description = 'Generates aggregated Javadoc API documentation.'
118+
title = "${rootProject.description} ${version} API"
119+
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
120+
options.author = true
121+
options.header = rootProject.description
122+
options.overview = 'src/api/overview.html'
123+
options.links(
124+
'http://docs.jboss.org/jbossas/javadoc/4.0.5/connector'
125+
)
126+
source subprojects.collect { project ->
127+
project.sourceSets.main.allJava
128+
}
129+
destinationDir = new File(buildDir, "api")
130+
classpath = files(subprojects.collect { project ->
131+
project.sourceSets.main.compileClasspath
132+
})
133+
maxMemory = '1024m'
134+
}
135+
136+
task docsZip(type: Zip) {
137+
group = 'Distribution'
138+
classifier = 'docs'
139+
description = "Builds -${classifier} archive containing api and reference " +
140+
"for deployment at static.springframework.org/spring-social/docs."
141+
142+
from('src/dist') {
143+
include 'changelog.txt'
144+
}
145+
146+
from (api) {
147+
into 'api'
148+
}
149+
150+
from (reference) {
151+
into 'reference'
152+
}
153+
}
154+
155+
task schemaZip(type: Zip) {
156+
group = 'Distribution'
157+
classifier = 'schema'
158+
description = "Builds -${classifier} archive containing all " +
159+
"XSDs for deployment at static.springframework.org/schema."
160+
161+
subprojects.each { subproject ->
162+
def Properties schemas = new Properties();
163+
164+
subproject.sourceSets.main.resources.find {
165+
it.path.endsWith('META-INF/spring.schemas')
166+
}?.withInputStream { schemas.load(it) }
167+
168+
for (def key : schemas.keySet()) {
169+
def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1')
170+
assert shortName != key
171+
File xsdFile = subproject.sourceSets.main.resources.find {
172+
it.path.endsWith(schemas.get(key))
173+
}
174+
assert xsdFile != null
175+
into (shortName) {
176+
from xsdFile.path
177+
}
178+
}
179+
}
180+
}
181+
182+
task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) {
183+
group = 'Distribution'
184+
classifier = 'dist'
185+
description = "Builds -${classifier} archive, containing all jars and docs, " +
186+
"suitable for community download page."
187+
188+
baseDir = "${project.name}-${project.version}";
189+
190+
from('src/dist') {
191+
include 'readme.txt'
192+
include 'license.txt'
193+
include 'notice.txt'
194+
into "${baseDir}"
195+
expand(copyright: new Date().format('yyyy'), version: project.version)
196+
}
197+
198+
from(zipTree(docsZip.archivePath)) {
199+
into "${baseDir}/docs"
200+
}
201+
202+
from(zipTree(schemaZip.archivePath)) {
203+
into "${baseDir}/schema"
204+
}
205+
206+
subprojects.each { subproject ->
207+
into ("${baseDir}/libs") {
208+
from subproject.jar
209+
if (subproject.tasks.findByPath('sourcesJar')) {
210+
from subproject.sourcesJar
211+
}
212+
if (subproject.tasks.findByPath('javadocJar')) {
213+
from subproject.javadocJar
214+
}
215+
}
216+
}
217+
}
218+
219+
artifacts {
220+
archives docsZip
221+
// archives schemaZip
222+
archives distZip
223+
}
224+
225+
task wrapper(type: Wrapper) {
226+
description = 'Generates gradlew[.bat] scripts'
227+
gradleVersion = '1.0-milestone-8a'
228+
}
229+
230+
}
231+
232+
task updateRootDocs << {
233+
copy {
234+
from 'src/dist'
235+
into "${rootProject.projectDir}"
236+
include 'notice.txt'
237+
expand(copyright: new Date().format('yyyy'), version: project.version)
238+
rename { filename -> 'NOTICE' }
239+
}
240+
241+
copy {
242+
from 'src/dist'
243+
into "${rootProject.projectDir}"
244+
include 'license.txt'
245+
rename { filename -> 'LICENSE' }
246+
}
150247
}
151248

152-
apply from: "$buildSrcDir/dist.gradle"
153-
apply from: "$buildSrcDir/checks.gradle"
249+
build.dependsOn('updateRootDocs')

buildSrc

-1
This file was deleted.

0 commit comments

Comments
 (0)