Skip to content

first support for meta-annotations for the integration tests #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 174 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
d52f883
Add test dependencies sources for testCompile
philwebb Jan 4, 2013
16a3a8b
Polish test sourceSet dependencies
philwebb Jan 4, 2013
bd1db73
Merge branch 'share-test-classes' into cleanup-3.2.x
cbeams Jan 4, 2013
2a30fa0
Replace test beans with test objects
philwebb Jan 2, 2013
42b5d6d
Remove duplicate test classes
philwebb Jan 3, 2013
d1e6dbe
Update Apache license headers for affected sources
cbeams Jan 4, 2013
b836e14
Merge branch 'cleanup-test-duplicates' into cleanup-3.2.x
cbeams Jan 4, 2013
0351787
Merge branch 'cleanup-3.2.x' into SPR-9431
cbeams Jan 4, 2013
51b3076
Fix warnings due to unused import statements
cbeams Jan 4, 2013
15e9fe6
Remove duplicate test resources
cbeams Jan 4, 2013
662a02b
Fix several miscellaneous compiler/Eclipse warnings
cbeams Jan 4, 2013
4272901
Move namespace tests to root integration module
cbeams Jan 4, 2013
6762316
Update Apache license headers for moved files
cbeams Jan 4, 2013
cf68cc5
Eliminate AJ @Async warning in test case
cbeams Jan 4, 2013
3a61e99
Merge branch 'SPR-9431' into cleanup-3.2.x
cbeams Jan 4, 2013
895feda
Merge branch 'cleanup-3.2.x' into 3.2.x
cbeams Jan 4, 2013
b78a8a4
Merge branch 'cleanup-3.2.x' into SPR-10126
philwebb Jan 4, 2013
4c0a306
Mark all IsFastEnough tests as performance tests
sslavic Jan 5, 2013
29dd91b
Merge pull request #212 from sslavic/SPR-9984
cbeams Jan 7, 2013
ad1fda5
Merge branch 'SPR-9984' into cleanup-3.2.x
cbeams Jan 7, 2013
00a86c3
Detect split packages at build time
Jan 3, 2013
a27a3be
Example SplitPackageDetectorPlugin
rwinch Jan 3, 2013
2df08bd
Rework split package detection code
Jan 4, 2013
f92f58d
Gradle 'api' task depends on 'jar' tasks
philwebb Jan 7, 2013
153508a
Support "X-Forwarded-Host" in UriComponentsBuilder
rstoyanchev Jan 7, 2013
15c0971
Merge branch 'cleanup-3.2.x' into 3.2.x
philwebb Jan 7, 2013
7bc9667
Add support for placeholders in @RequestMapping
rstoyanchev Jan 7, 2013
b8f223c
Add 3.1 migration section to reference docs
cbeams Jan 8, 2013
4611d15
Merge branch 'SPR-9843' into 3.2.x
cbeams Jan 8, 2013
2391277
Fix issue in BufferedImageHttpMessageConverter
rstoyanchev Jan 8, 2013
87109b3
Add decoding matrix variable values
rstoyanchev Jan 8, 2013
2ac4a8c
Update mvc chapter on annotations and proxies
rstoyanchev Jan 8, 2013
c7d0054
Remove closing tag in form tag's extra hidden fields
rstoyanchev Jan 8, 2013
a56d8f2
Add support for HTTP OPTIONS in Spring MVC Test
acogoluegnes Dec 14, 2012
0760594
Merge pull request #205 from acogoluegnes/SPR-10093
rstoyanchev Jan 8, 2013
0829cbf
Update license header for recently modified files
cbeams Jan 8, 2013
24ffa5a
Update info on RestTemplate related to 401 status code
rstoyanchev Jan 8, 2013
68d4a70
Add option to always append 'must-revalidate'
rstoyanchev Jan 8, 2013
f185c3a
Add option to not trim path segments in AntPathMatch
rstoyanchev Jan 8, 2013
2f6e45f
Add protected method to AbstractHandlerMethodMapping
rstoyanchev Jan 9, 2013
ee1ddc9
Replace EasyMock with Mockito in spring-orm
philwebb Jan 10, 2013
1386479
Merge branch 'SPR-10126' into cleanup-3.2.x
philwebb Jan 10, 2013
0b612d6
Merge branch 'cleanup-3.2.x' into 3.2.x
philwebb Jan 10, 2013
4ae9cf7
Ensure JUnit & TestNG tests run in spring-test
sbrannen Jan 10, 2013
10dceb1
Marked LocalCacheProviderProxy as deprecated (following Hibernate 3.3…
jhoeller Dec 21, 2012
3a9ca4a
MessageSourceResourceBundle overrides JDK 1.6 containsKey method, avo…
jhoeller Jan 3, 2013
97ae403
AbstractAdvisingBeanPostProcessor caches per bean target class, worki…
jhoeller Jan 4, 2013
f8a7cf9
MimeMessageHelper encodes attachment filename if not ASCII compliant
jhoeller Jan 9, 2013
5e8e901
FreeMarkerConfigurationFactory properly supports TemplateLoaders when…
jhoeller Jan 9, 2013
f6d7518
SpringContextResourceAdapter implements equals/hashCode according to …
jhoeller Jan 9, 2013
dae4485
Added dedicated sort method to AnnotationAwareOrderComparator
jhoeller Jan 10, 2013
e806c4e
AnnotationAwareOrderComparator is able to sort Class objects as well
jhoeller Jan 10, 2013
ea823fd
AnnotationAwareOrderComparator etc
jhoeller Jan 10, 2013
2427391
Polish Javadoc in CookieValue and RequestHeader
sbrannen Jan 10, 2013
91da138
Use explicit JDK versions in aspects.gradle
rwinch Jan 10, 2013
18bf860
Update Javadoc for MockMvc
sbrannen Jan 10, 2013
a0e5394
Exclude stax test dependency
philwebb Jan 11, 2013
c425d22
Exclude eclipse WTP generated artifacts
philwebb Jan 11, 2013
b8f408e
Replace space indentation with tabs
cbeams Jan 8, 2013
654c07d
Refactor detect-split-packages Gradle plugin
cbeams Jan 11, 2013
54d2846
Merge pull request #214 from glyn/SPR-9990
cbeams Jan 11, 2013
7413779
Polish changes from pull request #205
cbeams Jan 11, 2013
bfdc191
Merge branch 'SPR-10093' into 3.2.x
cbeams Jan 11, 2013
c1fe3c0
Polish DetectSplitPackagesPlugin
philwebb Jan 11, 2013
5b147bf
Improve speed of spring-test build
sbrannen Jan 11, 2013
2db7a12
Generate eclipse project settings from gradle
philwebb Jan 11, 2013
68970b7
Merge branch 'SPR-9518' into 3.2.x
philwebb Jan 11, 2013
f0a1ff2
JDBC parameter binding uses JDBC 3.0 ParameterMetaData (if available)…
jhoeller Jan 11, 2013
54c873b
Support multiple Validators in DataBinder
rstoyanchev Jan 11, 2013
5ddc313
Upgrade to prop-deps gradle plugin 0.0.3
philwebb Jan 11, 2013
fce7adc
Consider bridge methods in SpEL properties
philwebb Jan 11, 2013
e8fcde0
Polish author and copyright year
philwebb Jan 11, 2013
e4c1361
Remove accidentally committed interface @Override
philwebb Jan 11, 2013
8a37521
Fix copyright year & method names in spring-test
sbrannen Jan 14, 2013
8694a0a
Minor changes to AnnotationUtils
sbrannen Jan 14, 2013
f57c24c
Allow 'gradle eclipse' without 'cleanEclipse'
philwebb Jan 14, 2013
8bb6714
Fix eclipse .settings generation
philwebb Jan 14, 2013
d40bd8b
Tweak eclipse warning settings
philwebb Jan 14, 2013
bff36fb
Improve exceptions for multi-operand expressions
philwebb Jan 14, 2013
ad91fa6
SpEL support for static finals on interfaces
philwebb Jan 14, 2013
ad025b5
Prepend context/servlet path to FormTag action
rstoyanchev Jan 14, 2013
a16bad0
Update Validation chapter
rstoyanchev Jan 15, 2013
9dc7b5f
Use MessageSource to resolve @ResponseStatus.reason
rstoyanchev Jan 15, 2013
b2d6596
Add contentTypeCompatibleWith option to Spring MVC Test
rstoyanchev Jan 15, 2013
33ee0ea
Fix broken test in ContentAssertionTests
sbrannen Jan 15, 2013
f3e5f8b
Update copyright year, author tags, and Javadoc
sbrannen Jan 15, 2013
a321178
AbstractCacheManager accepts no caches defined, allowing for EHCache …
jhoeller Jan 15, 2013
abbe1db
Polishing along with backport
jhoeller Jan 15, 2013
450dbb2
Reintroduced "mode" and "proxy-target-class" attributes in spring-tas…
jhoeller Jan 15, 2013
2cd23a7
Polishing
jhoeller Jan 15, 2013
e44b4b8
Further fixes for 3.2.1
jhoeller Jan 15, 2013
6888a6f
Restore *.aj whitespace
rwinch Jan 15, 2013
26d5ef9
Handle non-void write methods deterministically
cbeams Dec 19, 2012
1944550
Polish build.gradle
cbeams Jan 16, 2013
e659dea
Remove .aj sources from spring-aspects jar
cbeams Jan 16, 2013
6a5744e
CachedIntrospectionResults.clearClassLoader(null) removes cached clas…
jhoeller Jan 16, 2013
d55877c
spring-jms-3.2.xsd allows for SpEL expressions in prefetch and receiv…
jhoeller Jan 17, 2013
8a12b9e
Removed reference to AttributesJmxAttributeSource
jhoeller Jan 18, 2013
cd2183f
Fixed ConnectionSpecConnectionFactoryAdapter explanation
jhoeller Jan 18, 2013
13cf1fc
Fixed reference to "fallbackToNoOpCache" flag
jhoeller Jan 18, 2013
be606f4
Added hint towards not using orm.hibernate3 classes with Hibernate 4
jhoeller Jan 18, 2013
20c4ba4
AbstractDriverBasedDataSource does not rely on Properties chaining an…
jhoeller Jan 18, 2013
721fa9d
SpringBeanAutowiringInterceptor eagerly releases BeanFactory if post-…
jhoeller Jan 18, 2013
3dd8175
MBeanExporter does not log warnings for manually unregistered MBeans
jhoeller Jan 18, 2013
ed952cc
LocalVariableTableParameterNameDiscoverer works for bridge methods as…
jhoeller Jan 18, 2013
8c9383d
BridgeMethodResolver properly handles bridge methods in interfaces
jhoeller Jan 18, 2013
701c5f1
ContextLoader properly detects pre-refreshed WebApplicationContext
jhoeller Jan 18, 2013
cca255b
Added "exposeAccessContext" flag JndiRmiClientInterceptor/ProxyFactor…
jhoeller Jan 18, 2013
944e1c9
EhCacheManagerFactoryBean applies cacheManagerName ahead of creation …
jhoeller Jan 18, 2013
87968e5
Further preparations for 3.2.1
jhoeller Jan 18, 2013
5d9ad5b
AbstractDriverBasedDataSource does not rely on Properties chaining an…
jhoeller Jan 18, 2013
24cc333
Fix typo in reference documentation
cbeams Jan 21, 2013
d40c8cf
Fix broken Castor URLs in ref docs and mapping XML
cbeams Jan 21, 2013
fc6377c
Add TimedSpringRunnerTests to performance test group
cbeams Jan 21, 2013
c97f26d
Merge branch 'SPR-9984' into 3.2.x
cbeams Jan 21, 2013
4dc3fce
Ensure -PtestGroups is passed through to unit tests
cbeams Jan 21, 2013
06017e7
Merge branch 'SPR-9984' into 3.2.x
cbeams Jan 21, 2013
cb8dc73
Attempt to repro ReflectionUtils performance issue
cbeams Jan 21, 2013
3c1536a
Merge branch 'SPR-10197' into 3.2.x
cbeams Jan 21, 2013
8e1685c
Fix ClassCastException in TilesConfigurer
rstoyanchev Jan 21, 2013
e4fcad9
Fix exception message about producible media types
rstoyanchev Jan 21, 2013
21becef
Support Date to String in JodaTimeConverters
philwebb Jan 21, 2013
0c56e86
Fix NPE in FormHttpMessageConverter
rstoyanchev Jan 21, 2013
902a136
Add helpful error message to DispServlet initializer
rstoyanchev Jan 21, 2013
660458a
Fix init order issue in RequestMappingHandlerMapping
rstoyanchev Jan 21, 2013
d9a4fb4
Introduce "dummy" Environment implementation
cbeams Jan 4, 2013
3cdb866
Relax ConfigurableWebEnvironment signatures
cbeams Jan 4, 2013
2a41de0
Polish Javadoc in Spring MVC async support
sbrannen Jan 22, 2013
3a626f9
Support XML properties in ResourcePropertySource
cbeams Jan 22, 2013
d5cad15
Merge branch 'SPR-9896' into 3.2.x
cbeams Jan 22, 2013
d3f4528
Remove additional xsd versions from reference docs
cbeams Jan 22, 2013
40ed4e7
Make UriComponents Serializable
rstoyanchev Jan 22, 2013
692ced8
Fix typo in reference docs
rstoyanchev Jan 22, 2013
c1a4f5c
MockHttpServletRequest's getParameter(Values) returns null for null p…
jhoeller Jan 21, 2013
5a773b7
MockHttpServletResponse's getHeaderNames declares Collection instead …
jhoeller Jan 21, 2013
8e75eee
SpringValidationAdapter properly detects invalid value for JSR-303 fi…
jhoeller Jan 22, 2013
1a929f2
EntityManagerFactoryUtils finds default EntityManagerFactory in paren…
jhoeller Jan 22, 2013
8f103c2
Introduced NoUniqueBeanDefinitionException as a dedicated subclass of…
jhoeller Jan 22, 2013
0a09da7
Final preparations for 3.2.1
jhoeller Jan 22, 2013
a3e190e
Support sub-types of ResponseEntity
rstoyanchev Jan 22, 2013
0efdd3d
Aligned XML scheduled-task elements with @Scheduled in terms of kicki…
jhoeller Jan 22, 2013
ece727b
Introduced NoUniqueBeanDefinitionException as a dedicated subclass of…
jhoeller Jan 22, 2013
3eec27a
Filter build folder resources in eclipse
philwebb Jan 22, 2013
05ba366
Polish AbstractContextLoader Javadoc
philwebb Jan 22, 2013
4d01d43
Test String to char[] conversion
philwebb Jan 22, 2013
3c09b07
Raise exception on missing request parameters
rstoyanchev Jan 22, 2013
9c032d5
Allow TypeDescriptor array construction
philwebb Jan 22, 2013
89db04e
Added "awaitTerminationSeconds" property to ThreadPoolTaskExecutor/Th…
jhoeller Jan 23, 2013
d5af9dc
Polishing
jhoeller Jan 23, 2013
5fb7530
Final preparations for 3.2.1
jhoeller Jan 23, 2013
7e74fd2
Consider primary attribute with getBean(Class)
philwebb Jan 23, 2013
a1aba23
Polish Javadoc in TypeDescriptor
sbrannen Jan 23, 2013
3b8aba9
Fix typo in ContextLifecycleScheduledTaskRegistrar
sbrannen Jan 23, 2013
e4f1f68
Update distribution README regarding paths
sbrannen Jan 23, 2013
9982b4c
Add BS and VT char escape sequences to JavaScriptUtils
rstoyanchev Jan 23, 2013
f3ff98d
Allow nulls with multiple embedded value resolvers
philwebb Jan 23, 2013
2ee70d6
Suppress serialization warning
rstoyanchev Jan 23, 2013
4dde7c4
MBeanInfoAssembler impls expose actual method parameter names if poss…
jhoeller Jan 23, 2013
a425d71
ThreadPoolExecutorFactoryBean exposes "createExecutor" method for cus…
jhoeller Jan 23, 2013
0dcc0f2
Added further MySQL error code for DataIntegrityViolationException
jhoeller Jan 23, 2013
4c823a3
DisposableBeanAdapter detects "shutdown" as a destroy method as well …
jhoeller Jan 23, 2013
ede9d53
Updated resolvePath javadoc to reflect Environment-based placeholder …
jhoeller Jan 23, 2013
049169d
ResourcePropertyResource accepts EncodedResource for properties files…
jhoeller Jan 23, 2013
e5d9378
Removed pre-JDK-1.5 checks
jhoeller Jan 23, 2013
5759269
Polishing
jhoeller Jan 23, 2013
919aeb5
Final preparations for 3.2.1
jhoeller Jan 23, 2013
7f928e8
Change merge.into project dependencies to provided
philwebb Jan 23, 2013
d46a82b
Added note on thread safety to TypeConverter and SimpleTypeConverter …
jhoeller Jan 24, 2013
078a1c5
Made EncodedResource based variant public; consistently detect XML pr…
jhoeller Jan 24, 2013
39c00c4
Avoid UnsupportedOperationEx. with active SecurityManager
cbeams Jan 24, 2013
0a6727c
Merge branch 'SPR-9970' into 3.2.x
cbeams Jan 24, 2013
8625504
Completed changelog entries for 3.2.1
jhoeller Jan 24, 2013
12e9b14
first support for meta-annotations for the integration tests
giovannidalloglio Jan 24, 2013
1855e3b
First documentation for meta-annotations support on spring-test
giovannidalloglio Jan 24, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@ jmx.log
derby.log
spring-test/test-output/
.gradle
.classpath
.project
argfile*
pom.xml

/build
buildSrc/build
/spring-*/build

# Eclipse artifacts, including WTP generated manifests
.classpath
.project
spring-*/src/main/java/META-INF/MANIFEST.MF

# IDEA artifacts and output dirs
*.iml
*.ipr
Expand Down
78 changes: 52 additions & 26 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
maven { url "http://repo.springsource.org/plugins-release" }
}
dependencies {
classpath("org.springframework.build.gradle:propdeps-plugin:0.0.1")
classpath("org.springframework.build.gradle:propdeps-plugin:0.0.3")
classpath("org.springframework.build.gradle:docbook-reference-plugin:0.2.4")
}
}
Expand All @@ -21,8 +21,6 @@ configure(allprojects) { project ->

apply plugin: "propdeps"
apply plugin: "java"
apply plugin: "propdeps-eclipse"
apply plugin: "propdeps-idea"
apply plugin: "test-source-set-dependencies"
apply from: "${gradleScriptDir}/ide.gradle"

Expand Down Expand Up @@ -60,7 +58,7 @@ configure(allprojects) { project ->

test {
systemProperty("java.awt.headless", "true")
systemProperty("testGroups", properties.get("testGroups"))
systemProperty("testGroups", project.properties.get("testGroups"))
}

repositories {
Expand All @@ -71,7 +69,7 @@ configure(allprojects) { project ->
testCompile("junit:junit:${junitVersion}")
testCompile("org.hamcrest:hamcrest-all:1.3")
testCompile("org.mockito:mockito-core:1.9.5")
if (project.name in ["spring", "spring-jms", "spring-orm",
if (project.name in ["spring", "spring-jms",
"spring-orm-hibernate4", "spring-oxm", "spring-struts",
"spring-test", "spring-test-mvc", "spring-tx", "spring-web",
"spring-webmvc", "spring-webmvc-portlet", "spring-webmvc-tiles3"]) {
Expand Down Expand Up @@ -235,7 +233,9 @@ project("spring-core") {
optional("net.sf.jopt-simple:jopt-simple:3.0")
optional("log4j:log4j:1.2.17")
testCompile("xmlunit:xmlunit:1.3")
testCompile("org.codehaus.woodstox:wstx-asl:3.2.7")
testCompile("org.codehaus.woodstox:wstx-asl:3.2.7") {
exclude group: "stax", module: "stax-api"
}
}

jar {
Expand Down Expand Up @@ -526,8 +526,8 @@ project("spring-orm-hibernate4") {
description = "Spring Object/Relational Mapping - Hibernate 4 support"
merge.into = project(":spring-orm")
dependencies {
compile(project(":spring-tx"))
compile(project(":spring-jdbc"))
provided(project(":spring-tx"))
provided(project(":spring-jdbc"))
optional("org.hibernate:hibernate-core:4.1.0.Final")
optional("org.hibernate:hibernate-entitymanager:4.1.0.Final")
optional(project(":spring-web"))
Expand Down Expand Up @@ -587,7 +587,6 @@ project("spring-webmvc") {
testCompile("commons-io:commons-io:1.3")
testCompile("org.hibernate:hibernate-validator:4.3.0.Final")
testCompile("org.apache.httpcomponents:httpclient:4.2")
testCompile(project(":spring-web").sourceSets.test.output)
}

// pick up DispatcherServlet.properties in src/main
Expand All @@ -598,7 +597,8 @@ project("spring-webmvc-tiles3") {
description = "Spring Framework Tiles3 Integration"
merge.into = project(":spring-webmvc")
dependencies {
compile(project(":spring-context"))
provided(project(":spring-context"))
provided(project(":spring-web"))
provided("javax.el:el-api:1.0")
provided("javax.servlet:jstl:1.2")
provided("javax.servlet.jsp:jsp-api:2.1")
Expand All @@ -613,11 +613,13 @@ project("spring-webmvc-tiles3") {
optional("org.apache.tiles:tiles-jsp:3.0.1") {
exclude group: "org.slf4j", module: "jcl-over-slf4j"
}
optional("org.apache.tiles:tiles-extras:3.0.1") {
exclude group: "org.slf4j", module: "jcl-over-slf4j"
}
optional("org.apache.tiles:tiles-el:3.0.1") {
exclude group: "org.slf4j", module: "jcl-over-slf4j"
}
provided("javax.servlet:javax.servlet-api:3.0.1")
compile(project(":spring-web").sourceSets*.output) // mock request & response
testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
}
}
Expand All @@ -641,10 +643,22 @@ project("spring-webmvc-portlet") {

project("spring-test") {
description = "Spring TestContext Framework"

task testNG(type: Test) {
useTestNG()
// "TestCase" classes are run by other test classes, not the build.
exclude "**/*TestCase.class"
// Generate TestNG reports alongside JUnit reports.
testReport true
}

test {
dependsOn testNG
useJUnit()
useTestNG()
// "TestCase" classes are run by other test classes, not the build.
exclude(["**/*TestCase.class", "**/*TestSuite.class"])
}

dependencies {
compile(project(":spring-core"))
optional(project(":spring-beans"))
Expand Down Expand Up @@ -675,8 +689,8 @@ project("spring-test-mvc") {
description = "Spring Test MVC Framework"
merge.into = project(":spring-test")
dependencies {
optional(project(":spring-context"))
compile(project(":spring-webmvc"))
provided(project(":spring-context"))
provided(project(":spring-webmvc"))
provided("javax.servlet:javax.servlet-api:3.0.1")
optional("org.hamcrest:hamcrest-core:1.3")
optional("com.jayway.jsonpath:json-path:0.8.1")
Expand Down Expand Up @@ -753,19 +767,23 @@ configure(rootProject) {

apply plugin: "docbook-reference"
apply plugin: "groovy"
apply plugin: "detect-split-packages"
apply from: "${gradleScriptDir}/jdiff.gradle"

reference {
sourceDir = file("src/reference/docbook")
pdfFilename = "spring-framework-reference.pdf"
}

// don"t publish the default jar for the root project
detectSplitPackages {
projectsToScan -= project(":spring-instrument-tomcat")
}

// don't publish the default jar for the root project
configurations.archives.artifacts.clear()

dependencies { // for integration tests
testCompile(project(":spring-core"))
testCompile(project(":spring-core").sourceSets.test.output)
testCompile(project(":spring-beans"))
testCompile(project(":spring-aop"))
testCompile(project(":spring-expression"))
Expand All @@ -790,6 +808,11 @@ configure(rootProject) {
description = "Generates aggregated Javadoc API documentation."
title = "${rootProject.description} ${version} API"

dependsOn {
subprojects.collect {
it.tasks.getByName("jar")
}
}
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
options.author = true
options.header = rootProject.description
Expand All @@ -801,18 +824,20 @@ configure(rootProject) {
project.sourceSets.main.allJava
}

classpath = files(
// ensure servlet 3.x and Hibernate 4.x have precedence on the Javadoc
// classpath over their respective 2.5 and 3.x variants
project(":spring-webmvc").sourceSets.main.compileClasspath.files.find { it =~ "servlet-api" },
rootProject.sourceSets.test.compileClasspath.files.find { it =~ "hibernate-core" },
// ensure the javadoc process can resolve types compiled from .aj sources
project(":spring-aspects").sourceSets.main.output
)
classpath += files(subprojects.collect { it.sourceSets.main.compileClasspath })

maxMemory = "1024m"
destinationDir = new File(buildDir, "api")

doFirst {
classpath = files(
// ensure servlet 3.x and Hibernate 4.x have precedence on the Javadoc
// classpath over their respective 2.5 and 3.x variants
project(":spring-webmvc").sourceSets.main.compileClasspath.files.find { it =~ "servlet-api" },
rootProject.sourceSets.test.compileClasspath.files.find { it =~ "hibernate-core" },
// ensure the javadoc process can resolve types compiled from .aj sources
project(":spring-aspects").sourceSets.main.output
)
classpath += files(subprojects.collect { it.sourceSets.main.compileClasspath })
}
}

task docsZip(type: Zip) {
Expand Down Expand Up @@ -954,6 +979,7 @@ configure(rootProject) {
"set GRADLE_OPTS=$gradleBatOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=")
}
}

}

/*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
/*
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.springframework.build.gradle

import org.gradle.api.DefaultTask
import org.gradle.api.GradleException
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.TaskAction


/**
* Gradle plugin that detects identically named, non-empty packages split across multiple
* subprojects, e.g. "org.springframework.context.annotation" existing in both spring-core
* and spring-aspects. Adds a 'detectSplitPackages' task to the current project's task
* collection. If the project already contains a 'check' task (i.e. is a typical Gradle
* project with the "java" plugin applied), the 'check' task will be updated to depend on
* the execution of 'detectSplitPackages'.
*
* By default, all subprojects will be scanned. Use the 'projectsToScan' task property to
* modify this value. Example usage:
*
* apply plugin: 'detect-split-packages // typically applied to root project
*
* detectSplitPackages {
* packagesToScan -= project(":spring-xyz") // scan every project but spring-xyz
* }
*
* @author Rob Winch
* @author Glyn Normington
* @author Chris Beams
*/
public class DetectSplitPackagesPlugin implements Plugin<Project> {
public void apply(Project project) {
def tasks = project.tasks
Task detectSplitPackages = tasks.add("detectSplitPackages", DetectSplitPackagesTask.class)
if (tasks.asMap.containsKey("check")) {
tasks.getByName("check").dependsOn detectSplitPackages
}
}
}

public class DetectSplitPackagesTask extends DefaultTask {

private static final String JAVA_FILE_SUFFIX = ".java"
private static final String PACKAGE_SEPARATOR = "."
private static final String HIDDEN_DIRECTORY_PREFIX = "."

@Input
Set<Project> projectsToScan = project.subprojects

public DetectSplitPackagesTask() {
this.group = "Verification"
this.description = "Detects packages split across two or more subprojects."
}

@TaskAction
public void detectSplitPackages() {
def splitPackages = doDetectSplitPackages()
if (!splitPackages.isEmpty()) {
def message = "The following split package(s) have been detected:\n"
splitPackages.each { pkg, mod ->
message += " - ${pkg} (split across ${mod[0].name} and ${mod[1].name})\n"
}
throw new GradleException(message)
}
}

private Map<String, List<Project>> doDetectSplitPackages() {
def splitPackages = [:]
def mergedProjects = findMergedProjects()
def packagesByProject = mapPackagesByProject()

def projects = packagesByProject.keySet().toArray()
def nProjects = projects.length

for (int i = 0; i < nProjects - 1; i++) {
for (int j = i + 1; j < nProjects - 1; j++) {
def prj_i = projects[i]
def prj_j = projects[j]

def pkgs_i = new HashSet(packagesByProject.get(prj_i))
def pkgs_j = packagesByProject.get(prj_j)
pkgs_i.retainAll(pkgs_j)

if (!pkgs_i.isEmpty()
&& mergedProjects.get(prj_i) != prj_j
&& mergedProjects.get(prj_j) != prj_i) {
pkgs_i.each { pkg ->
def readablePkg = pkg.substring(1).replaceAll(File.separator, PACKAGE_SEPARATOR)
splitPackages[readablePkg] = [prj_i, prj_j]
}
}
}
}
return splitPackages;
}

private Map<Project, Set<String>> mapPackagesByProject() {
def packagesByProject = [:]
this.projectsToScan.each { Project p ->
def packages = new HashSet<String>()
p.sourceSets.main.java.srcDirs.each { File dir ->
findPackages(packages, dir, "")
}
if (!packages.isEmpty()) {
packagesByProject.put(p, packages)
}
}
return packagesByProject;
}

private Map<Project, Project> findMergedProjects() {
def mergedProjects = [:]
this.projectsToScan.findAll { p ->
p.plugins.findPlugin(MergePlugin)
}.findAll { p ->
p.merge.into
}.each { p ->
mergedProjects.put(p, p.merge.into)
}
return mergedProjects
}

private static void findPackages(Set<String> packages, File dir, String packagePath) {
def scanDir = new File(dir, packagePath)
def File[] javaFiles = scanDir.listFiles({ file ->
!file.isDirectory() && file.name.endsWith(JAVA_FILE_SUFFIX)
} as FileFilter)

if (javaFiles != null && javaFiles.length != 0) {
packages.add(packagePath)
}

scanDir.listFiles({ File file ->
file.isDirectory() && !file.name.startsWith(HIDDEN_DIRECTORY_PREFIX)
} as FileFilter).each { File subDir ->
findPackages(packages, dir, packagePath + File.separator + subDir.name)
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class TestSourceSetDependenciesPlugin implements Plugin<Project> {

private void collectProjectDependencies(Set<ProjectDependency> projectDependencies,
Project project) {
for(def configurationName in ["compile", "optional", "provided"]) {
for(def configurationName in ["compile", "optional", "provided", "testCompile"]) {
Configuration configuration = project.getConfigurations().findByName(configurationName)
if(configuration) {
configuration.dependencies.findAll { it instanceof ProjectDependency }.each {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
implementation-class=org.springframework.build.gradle.DetectSplitPackagesPlugin
Loading