comparison init.gradle @ 83:9c551ecc816a

clean up script to be more maintainable
author smith@nwoca.org
date Thu, 09 Feb 2012 17:19:06 -0500
parents c7cbf5e9db74
children fa7b349201eb
comparison
equal deleted inserted replaced
82:c7cbf5e9db74 83:9c551ecc816a
11 task wrapper(type: Wrapper) { 11 task wrapper(type: Wrapper) {
12 gradleVersion = '1.0-milestone-7' 12 gradleVersion = '1.0-milestone-7'
13 } 13 }
14 14
15 wrapper << { 15 wrapper << {
16 // patch wrapper path for 1.0-milestone-7 bug (http://issues.gradle.org/browse/GRADLE-1823) 16 // patch wrapper path for 1.0-milestone-7 (http://issues.gradle.org/browse/GRADLE-1823)
17 ant.replace(file: 'gradlew', token: '\\wrapper\\gradle-wrapper.jar',value:'/wrapper/gradle-wrapper.jar') 17 ant.replace(file: 'gradlew', token: '\\wrapper\\gradle-wrapper.jar',value:'/wrapper/gradle-wrapper.jar')
18 } 18 }
19
20 19
21 allprojects { 20 allprojects {
22 task cleanLocal << { 21 task cleanLocal << {
23 def local = project.repositories.find { it.name == 'local' } 22 def local = project.repositories.find { it.name == 'local' }
24 if ( local ) { 23 if ( local ) {
34 } 33 }
35 34
36 class ArtifactoryGradleSettings extends BuildAdapter implements BuildListener { 35 class ArtifactoryGradleSettings extends BuildAdapter implements BuildListener {
37 36
38 def void projectsEvaluated(Gradle gradle) { 37 def void projectsEvaluated(Gradle gradle) {
38 def ssdtArtifactory = 'http://repos.ssdt.nwoca.org/artifactory'
39 Project root = gradle.getRootProject() 39 Project root = gradle.getRootProject()
40 root.allprojects { 40 root.allprojects {
41 def thisProject = delegate 41 def thisProject = delegate
42
43 configurations.all { 42 configurations.all {
44 resolutionStrategy.cacheChangingModulesFor 120, 'minutes' 43 resolutionStrategy.cacheChangingModulesFor 120, 'minutes'
45 resolutionStrategy.cacheDynamicVersionsFor 120, 'minutes' 44 resolutionStrategy.cacheDynamicVersionsFor 120, 'minutes'
46 } 45 }
47 repositories { 46 repositories {
53 descriptor = 'optional' 52 descriptor = 'optional'
54 checkmodified = true 53 checkmodified = true
55 } 54 }
56 } 55 }
57 add(new org.apache.ivy.plugins.resolver.URLResolver()) { 56 add(new org.apache.ivy.plugins.resolver.URLResolver()) {
58 name = 'ssdt-snapshots' 57 name = 'ssdt-snapshots'
59 m2compatible = true 58 m2compatible = true
60 url = 'http://repos.ssdt.nwoca.org/artifactory/ssdt-snapshots' 59 url = "${ssdtArtifactory}/ssdt-snapshots"
61 addArtifactPattern('http://repos.ssdt.nwoca.org/artifactory/ssdt-snapshots/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]') 60 addArtifactPattern("${url}/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]")
62 addIvyPattern('http://repos.ssdt.nwoca.org/artifactory/ssdt-snapshots/[organization]/[module]/ivy-[revision].xml') 61 addIvyPattern("${url}/[organization]/[module]/ivy-[revision].xml")
63 checkmodified = true 62 checkmodified = true
64 changingMatcher = 'regexp' 63 changingMatcher = 'regexp'
65 changingPattern = '.*SNAPSHOT' 64 changingPattern = '.*SNAPSHOT'
66 } 65 }
67 add(new org.apache.ivy.plugins.resolver.URLResolver()) { 66 add(new org.apache.ivy.plugins.resolver.URLResolver()) {
68 name = 'ssdt-releases' 67 name = 'ssdt-releases'
69 m2compatible = false 68 m2compatible = false
70 url = 'http://repos.ssdt.nwoca.org/artifactory/ssdt-releases' 69 url = "${ssdtArtifactory}/ssdt-releases"
71 addArtifactPattern('http://repos.ssdt.nwoca.org/artifactory/ssdt-releases/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]') 70 addArtifactPattern("${url}/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]")
72 addIvyPattern('http://repos.ssdt.nwoca.org/artifactory/ssdt-releases/[organization]/[module]/ivy-[revision].xml') 71 addIvyPattern("${url}/[organization]/[module]/ivy-[revision].xml")
73 } 72 }
74 mavenRepo name: 'ssdt-repo', url: 'http://repos.ssdt.nwoca.org/artifactory/ssdt-repo' 73 mavenRepo name: 'ssdt-repo', url: "${ssdtArtifactory}/ssdt-repo"
75 74
76 } 75 }
77 76
78 if ( thisProject.repositories.find { it.name == 'local' } ) { 77 if ( thisProject.repositories.find { it.name == 'local' } ) {
79 uploadArchives { 78 uploadArchives {