Permalink
Browse files

fix broken idea/eclipse commands

  • Loading branch information...
1 parent 2cd9a51 commit 9b3ba7f72fd1c72b88ddbaca3583d52bcd6fdd57 @graemerocher graemerocher committed Mar 20, 2013
View
@@ -101,12 +101,14 @@ allprojects {
apply from: "gradle/idea.gradle"
subprojects { project ->
+ ext.isTestSuite = project.name.startsWith("grails-test-suite")
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'project-report'
- apply plugin: 'signing'
+ if(!isTestSuite)
+ apply plugin: 'signing'
//apply plugin: 'duplicates'
sourceCompatibility = "1.5"
@@ -166,11 +168,6 @@ subprojects { project ->
compile "org.slf4j:slf4j-api:$slf4jVersion"
compile "org.slf4j:jcl-over-slf4j:$slf4jVersion"
- // Specs
-// compile 'javax.servlet:javax.servlet-api:3.0.1'
-// compile 'org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final'
-
-
// Testing
testCompile "junit:junit:${junitVersion}"
testCompile("org.spockframework:spock-core:${spockVersion}") {
@@ -183,14 +180,17 @@ subprojects { project ->
excludes = ["**/*TestCase.class", "**/*\$*.class"]
}
- task sourcesJar(type: Jar) {
- classifier = 'sources'
- from sourceSets.main.allSource
- }
+ if(!isTestSuite) {
+ task sourcesJar(type: Jar) {
+ classifier = 'sources'
+ from sourceSets.main.allSource
+ }
+
+ task javadocJar(type: Jar, dependsOn:javadoc) {
+ classifier = 'javadoc'
+ from javadoc.destinationDir
+ }
- task javadocJar(type: Jar, dependsOn:javadoc) {
- classifier = 'javadoc'
- from javadoc.destinationDir
}
groovydoc.doLast {
@@ -203,137 +203,140 @@ subprojects { project ->
all*.exclude group:'commons-logging', module: 'commons-logging'
}
- artifacts {
- archives jar
- archives sourcesJar
- archives javadocJar
- }
-
- signing {
- sign configurations.archives
- required { !isBuildSnapshot && gradle.taskGraph.hasTask(uploadPublished) }
- }
+ if(!isTestSuite) {
+ artifacts {
+ archives jar
+ archives sourcesJar
+ archives javadocJar
+ }
- ext {
- poms = [project.install.repositories.mavenInstaller.pom]
- pomModifications = []
- modifyPom = { Closure modification -> project.pomModifications << modification }
- }
-
- task installToHomeDist(type: Upload) {
- configuration = configurations.archives
- repositories {
- project.poms << mavenDeployer {
- repository(url: distInstallDir.toURL())
- uniqueVersion = false
- pom.artifactId = project.name
- }.pom
+ signing {
+ sign configurations.archives
+ required { !isBuildSnapshot && gradle.taskGraph.hasTask(uploadPublished) }
}
- }
- install.dependsOn installToHomeDist
- install.doLast {
- ant.copy(todir:homeDistDir, flatten:true, includeEmptyDirs:false) {
- fileset dir:distInstallDir
+ ext {
+ poms = [project.install.repositories.mavenInstaller.pom]
+ pomModifications = []
+ modifyPom = { Closure modification -> project.pomModifications << modification }
+ }
+
+ task installToHomeDist(type: Upload) {
+ configuration = configurations.archives
+ repositories {
+ project.poms << mavenDeployer {
+ repository(url: distInstallDir.toURL())
+ uniqueVersion = false
+ pom.artifactId = project.name
+ }.pom
+ }
}
- }
- uploadPublished {
- repositories {
- final url = project.version.endsWith("SNAPSHOT") ? "http://repo.grails.org/grails/libs-snapshots-local" :
- "http://repo.grails.org/grails/libs-releases-local"
+ install.dependsOn installToHomeDist
+ install.doLast {
+ ant.copy(todir:homeDistDir, flatten:true, includeEmptyDirs:false) {
+ fileset dir:distInstallDir
+ }
+ }
- repositories {
- project.poms << mavenDeployer {
- repository(url: url) {
- final username = project.hasProperty("artifactoryPublishUsername") ? project.artifactoryPublishUsername : null
- final password = project.hasProperty("artifactoryPublishPassword") ? project.artifactoryPublishPassword : null
+ uploadPublished {
+ repositories {
+ final url = project.version.endsWith("SNAPSHOT") ? "http://repo.grails.org/grails/libs-snapshots-local" :
+ "http://repo.grails.org/grails/libs-releases-local"
- if(username && password) {
- org.apache.ivy.util.url.CredentialsStore.INSTANCE.addCredentials("Artifactory Realm", "repo.grails.org", username, password);
- }
+ repositories {
+ project.poms << mavenDeployer {
+ repository(url: url) {
+ final username = project.hasProperty("artifactoryPublishUsername") ? project.artifactoryPublishUsername : null
+ final password = project.hasProperty("artifactoryPublishPassword") ? project.artifactoryPublishPassword : null
- authentication(userName: username, password: password)
- }
- }.pom
- project.poms << mavenDeployer {
- beforeDeployment { MavenDeployment deployment -> signPom(deployment) }
+ if(username && password) {
+ org.apache.ivy.util.url.CredentialsStore.INSTANCE.addCredentials("Artifactory Realm", "repo.grails.org", username, password);
+ }
- repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
- authentication(userName: project.hasProperty("sonatypeUsername") ? project.sonatypeUsername : null,
- password: project.hasProperty("sonatypePassword") ? project.sonatypePassword : null)
- }
- snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
- authentication(userName: project.hasProperty("sonatypeUsername") ? project.sonatypeUsername : null,
- password: project.hasProperty("sonatypePassword") ? project.sonatypePassword : null)
- }
+ authentication(userName: username, password: password)
+ }
+ }.pom
+ project.poms << mavenDeployer {
+ beforeDeployment { MavenDeployment deployment -> signPom(deployment) }
-
- }.pom
- }
- }
- }
+ repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
+ authentication(userName: project.hasProperty("sonatypeUsername") ? project.sonatypeUsername : null,
+ password: project.hasProperty("sonatypePassword") ? project.sonatypePassword : null)
+ }
+ snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
+ authentication(userName: project.hasProperty("sonatypeUsername") ? project.sonatypeUsername : null,
+ password: project.hasProperty("sonatypePassword") ? project.sonatypePassword : null)
+ }
- modifyPom { pom ->
- pom.project {
- name 'Grails'
- packaging 'jar'
- description 'Grails Web Application Framework'
- delegate.url 'http://grails.org/'
-
- scm {
- delegate.url 'scm:git@github.com:grails/grails-core.git'
- connection 'scm:git@github.com:grails/grails-core.git'
- developerConnection 'scm:git@github.com:grails/grails-core.git'
+
+ }.pom
}
+ }
+ }
- licenses {
- license {
- name 'The Apache Software License, Version 2.0'
- delegate.url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
- distribution 'repo'
+ modifyPom { pom ->
+ pom.project {
+ name 'Grails'
+ packaging 'jar'
+ description 'Grails Web Application Framework'
+ delegate.url 'http://grails.org/'
+
+ scm {
+ delegate.url 'scm:git@github.com:grails/grails-core.git'
+ connection 'scm:git@github.com:grails/grails-core.git'
+ developerConnection 'scm:git@github.com:grails/grails-core.git'
}
- }
- developers {
- developer {
- id 'graemerocher'
- name 'Graeme Rocher'
+ licenses {
+ license {
+ name 'The Apache Software License, Version 2.0'
+ delegate.url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+ distribution 'repo'
+ }
}
- developer {
- id 'jeffscottbrown'
- name 'Jeff Brown'
+
+ developers {
+ developer {
+ id 'graemerocher'
+ name 'Graeme Rocher'
+ }
+ developer {
+ id 'jeffscottbrown'
+ name 'Jeff Brown'
+ }
}
}
}
- }
- // Map the groovy gradle configuration to the “compile” scope in our published POMs
- def groovyConfiguration = project.configurations.findByName("groovy")
- if (groovyConfiguration) {
- modifyPom {
- it.scopeMappings.addMapping(1, groovyConfiguration, "compile")
+ // Map the groovy gradle configuration to the “compile” scope in our published POMs
+ def groovyConfiguration = project.configurations.findByName("groovy")
+ if (groovyConfiguration) {
+ modifyPom {
+ it.scopeMappings.addMapping(1, groovyConfiguration, "compile")
+ }
}
- }
- // Remove any dependencies that shouldn't be included in the POM
- modifyPom { pom ->
- // respect 'optional' and 'provided' dependencies
- optionalDeps.each { dep ->
- pom.dependencies.find { it.artifactId == dep.name }?.optional = true
- }
- providedDeps.each { dep ->
- pom.dependencies.find { it.artifactId == dep.name }?.scope = 'provided'
- }
+ // Remove any dependencies that shouldn't be included in the POM
+ modifyPom { pom ->
+ // respect 'optional' and 'provided' dependencies
+ optionalDeps.each { dep ->
+ pom.dependencies.find { it.artifactId == dep.name }?.optional = true
+ }
+ providedDeps.each { dep ->
+ pom.dependencies.find { it.artifactId == dep.name }?.scope = 'provided'
+ }
- configurations.runtime.allDependencies.each { dependency ->
- if (dependency.hasProperty("notInPom") && dependency.notInPom) {
- pom.dependencies.removeAll { it.groupId == dependency.group && it.artifactId == dependency.name }
+ configurations.runtime.allDependencies.each { dependency ->
+ if (dependency.hasProperty("notInPom") && dependency.notInPom) {
+ pom.dependencies.removeAll { it.groupId == dependency.group && it.artifactId == dependency.name }
+ }
}
}
+
+ poms*.whenConfigured { pomModifications*.call(it) }
}
-
- poms*.whenConfigured { pomModifications*.call(it) }
+
}
task clean(type: Delete) {
@@ -92,7 +92,7 @@ task populateDependencies(type: Sync, dependsOn: configurePopulateDependencies)
// Can't use sync task here because this directory contains other things as well.
task sourcesJars(type: Sync) {
into homeSrcDir
- from subprojects*.sourcesJar*.outputs*.files
+ from subprojects.findAll { !it.name.startsWith('grails-test-suite') }.sourcesJar*.outputs*.files
// sourcesFor comes from GrailsBuildPlugin
from { sourcesFor(libsConfigurations*.copyRecursive { it.name.startsWith('grails-datastore') }.collect { it.transitive = false; it }) }
@@ -176,7 +176,7 @@ task installResources(type: Copy) {
}
}
-task install(dependsOn: [populateDependencies, installResources] + subprojects*.install)
+task install(dependsOn: [populateDependencies, installResources] + subprojects.findAll { !it.name.startsWith('grails-test-suite') }*.install)
task zipDist(type: Zip, dependsOn: [sourcesJars, install]) {
destinationDir = "${buildDir}/distributions" as File
@@ -41,6 +41,7 @@ dependencies {
compile("org.springframework:spring-test:${springVersion}") {
exclude group: 'commons-logging', module:'commons-logging'
+ ext.notInPom = true
}
compile("org.springframework:spring-web:${springVersion}") {
@@ -8,6 +8,7 @@ dependencies {
exclude group: 'org.grails', module:'grails-datastore-core'
exclude group: 'org.grails', module:'grails-bootstrap'
exclude group: 'org.grails', module:'grails-core'
+ exclude group: 'org.grails', module:'grails-async'
exclude group: 'org.grails', module:'grails-test'
exclude group: 'org.slf4j', module:'jcl-over-slf4j'
exclude group: 'org.slf4j', module:'jul-to-slf4j'
@@ -27,6 +28,7 @@ dependencies {
exclude group: 'org.slf4j', module:'slf4j-simple'
exclude group: 'org.grails', module:'grails-bootstrap'
exclude group: 'org.grails', module:'grails-core'
+ exclude group: 'org.grails', module:'grails-async'
exclude group: 'commons-collections', module:'commons-collections'
exclude group: 'commons-lang', module:'commons-lang'
exclude group: 'javassist', module:'javassist'
@@ -14,9 +14,11 @@ dependencies {
// Datastore APIs
compile("org.grails:grails-datastore-gorm:$datastoreVersion") {
transitive = false
+ exclude group: 'org.grails', module:'grails-datastore-core'
exclude group: 'org.grails', module:'grails-bootstrap'
exclude group: 'org.grails', module:'grails-core'
exclude group: 'org.grails', module:'grails-test'
+ exclude group: 'org.grails', module:'grails-async'
exclude group: 'org.slf4j', module:'jcl-over-slf4j'
exclude group: 'org.slf4j', module:'jul-to-slf4j'
exclude group: 'org.slf4j', module:'slf4j-api'
@@ -36,6 +38,7 @@ dependencies {
exclude group: 'org.grails', module:'grails-bootstrap'
exclude group: 'org.grails', module:'grails-core'
exclude group: 'org.grails', module:'grails-test'
+ exclude group: 'org.grails', module:'grails-async'
exclude group: 'commons-collections', module:'commons-collections'
exclude group: 'commons-lang', module:'commons-lang'
exclude group: 'javassit', module:'javassist'
@@ -18,7 +18,30 @@ dependencies {
project(':grails-crud'),
project(':grails-plugin-log4j')
- testCompile "org.grails:grails-datastore-gorm-hibernate:$datastoreVersion"
+ testCompile "org.grails:grails-datastore-gorm-hibernate:$datastoreVersion", {
+ exclude group: 'org.grails', module:'grails-datastore-gorm'
+ exclude group: 'org.grails', module:'grails-datastore-core'
+ exclude group: 'org.springframework', module:'spring-core'
+ exclude group: 'org.springframework', module:'spring-context'
+ exclude group: 'org.springframework', module:'spring-web'
+ exclude group: 'org.springframework', module:'spring-beans'
+ exclude group: 'org.springframework', module:'spring-tx'
+ exclude group: 'org.slf4j', module:'jcl-over-slf4j'
+ exclude group: 'org.slf4j', module:'jul-to-slf4j'
+ exclude group: 'org.slf4j', module:'slf4j-api'
+ exclude group: 'org.slf4j', module:'slf4j-simple'
+ exclude group: 'org.grails', module:'grails-bootstrap'
+ exclude group: 'org.grails', module:'grails-plugin-domain-class'
+ exclude group: 'org.grails', module:'grails-core'
+ exclude group: 'org.grails', module:'grails-web'
+ exclude group: 'org.grails', module:'grails-test'
+ exclude group: 'org.grails', module:'grails-async'
+ exclude group: 'commons-collections', module:'commons-collections'
+ exclude group: 'commons-lang', module:'commons-lang'
+ exclude group: 'javassit', module:'javassist'
+ exclude group: 'java-persistence', module:'persistence-api'
+ exclude group: 'javassist', module: 'javassist'
+ }
}
test {
Oops, something went wrong.

0 comments on commit 9b3ba7f

Please sign in to comment.