Mercurial > public > develkit
annotate init.gradle @ 92:90325a10fe95
correct develkit location
author | smith@nwoca.org |
---|---|
date | Wed, 22 Feb 2012 04:50:48 +0000 |
parents | b72ba5cb5c53 |
children | 1290b23e7b76 |
rev | line source |
---|---|
91 | 1 |
2 gradle.ssdtDevelkitLocation = gradle.hasProperty('ssdtDevelkitLocation') ? gradle.ssdtDevelkitLocation : 'http://hg.ssdt-ohio.org/browse/public/develkit' | |
73 | 3 |
4 gradle.addListener(new ArtifactoryGradleSettings()) | |
5 | |
77 | 6 gradle.bambooBuild = System.getenv().any { it.key.startsWith('BAMBOO')} |
79 | 7 logger.info "applying SSDT artifactory Gradle Settings (bamboo: $gradle.bambooBuild)" |
8 | |
9 if (gradle.bambooBuild) { | |
85 | 10 gradle.ssdtGradlekitLocation = gradle.hasProperty('ssdtGradlekitLocation') ? gradle.ssdtGradlekitLocation : 'http://hg.ssdt-ohio.org/ssdt/gradlekit/raw-file/tip' |
11 apply from: "${gradle.ssdtGradlekitLocation}/artifactory.gradle" | |
79 | 12 } |
76 | 13 |
85 | 14 |
15 apply from: "${gradle.ssdtDevelkitLocation}/metrics.gradle" | |
16 | |
81
36b2fd9e3861
fix handling of multi-project artifacts and local repos
smith@nwoca.org
parents:
80
diff
changeset
|
17 task wrapper(type: Wrapper) { |
36b2fd9e3861
fix handling of multi-project artifacts and local repos
smith@nwoca.org
parents:
80
diff
changeset
|
18 gradleVersion = '1.0-milestone-7' |
36b2fd9e3861
fix handling of multi-project artifacts and local repos
smith@nwoca.org
parents:
80
diff
changeset
|
19 } |
36b2fd9e3861
fix handling of multi-project artifacts and local repos
smith@nwoca.org
parents:
80
diff
changeset
|
20 |
36b2fd9e3861
fix handling of multi-project artifacts and local repos
smith@nwoca.org
parents:
80
diff
changeset
|
21 wrapper << { |
83 | 22 // patch wrapper path for 1.0-milestone-7 (http://issues.gradle.org/browse/GRADLE-1823) |
81
36b2fd9e3861
fix handling of multi-project artifacts and local repos
smith@nwoca.org
parents:
80
diff
changeset
|
23 ant.replace(file: 'gradlew', token: '\\wrapper\\gradle-wrapper.jar',value:'/wrapper/gradle-wrapper.jar') |
36b2fd9e3861
fix handling of multi-project artifacts and local repos
smith@nwoca.org
parents:
80
diff
changeset
|
24 } |
36b2fd9e3861
fix handling of multi-project artifacts and local repos
smith@nwoca.org
parents:
80
diff
changeset
|
25 |
36b2fd9e3861
fix handling of multi-project artifacts and local repos
smith@nwoca.org
parents:
80
diff
changeset
|
26 allprojects { |
85 | 27 |
84 | 28 task cleanLocal(description: "removes all artifacts from developer's local repository") << { |
29 | |
75 | 30 def local = project.repositories.find { it.name == 'local' } |
81
36b2fd9e3861
fix handling of multi-project artifacts and local repos
smith@nwoca.org
parents:
80
diff
changeset
|
31 if ( local ) { |
36b2fd9e3861
fix handling of multi-project artifacts and local repos
smith@nwoca.org
parents:
80
diff
changeset
|
32 logger.info "removing local repo: $it" |
36b2fd9e3861
fix handling of multi-project artifacts and local repos
smith@nwoca.org
parents:
80
diff
changeset
|
33 new File(System.properties['user.home'] + "/.ssdt/local-repo").deleteDir() |
75 | 34 } |
79 | 35 } |
85 | 36 |
78
e47f80ef056b
finish cleanLocal. start adding artifactory plugin
smith@nwoca.org
parents:
77
diff
changeset
|
37 cleanLocal.onlyIf { |
81
36b2fd9e3861
fix handling of multi-project artifacts and local repos
smith@nwoca.org
parents:
80
diff
changeset
|
38 project.repositories.any { it.name == 'local' } |
79 | 39 } |
81
36b2fd9e3861
fix handling of multi-project artifacts and local repos
smith@nwoca.org
parents:
80
diff
changeset
|
40 |
75 | 41 } |
42 | |
73 | 43 class ArtifactoryGradleSettings extends BuildAdapter implements BuildListener { |
79 | 44 |
73 | 45 def void projectsEvaluated(Gradle gradle) { |
83 | 46 def ssdtArtifactory = 'http://repos.ssdt.nwoca.org/artifactory' |
79 | 47 Project root = gradle.getRootProject() |
81
36b2fd9e3861
fix handling of multi-project artifacts and local repos
smith@nwoca.org
parents:
80
diff
changeset
|
48 root.allprojects { |
83 | 49 def thisProject = delegate |
74 | 50 configurations.all { |
51 resolutionStrategy.cacheChangingModulesFor 120, 'minutes' | |
52 resolutionStrategy.cacheDynamicVersionsFor 120, 'minutes' | |
79 | 53 } |
73 | 54 repositories { |
81
36b2fd9e3861
fix handling of multi-project artifacts and local repos
smith@nwoca.org
parents:
80
diff
changeset
|
55 if (!gradle.bambooBuild) { |
36b2fd9e3861
fix handling of multi-project artifacts and local repos
smith@nwoca.org
parents:
80
diff
changeset
|
56 add(new org.apache.ivy.plugins.resolver.FileSystemResolver()) { |
36b2fd9e3861
fix handling of multi-project artifacts and local repos
smith@nwoca.org
parents:
80
diff
changeset
|
57 name = 'local' |
36b2fd9e3861
fix handling of multi-project artifacts and local repos
smith@nwoca.org
parents:
80
diff
changeset
|
58 addIvyPattern System.properties['user.home'] + "/.ssdt/local-repo/[module]-ivy-[revision].xml" |
36b2fd9e3861
fix handling of multi-project artifacts and local repos
smith@nwoca.org
parents:
80
diff
changeset
|
59 addArtifactPattern System.properties['user.home'] + "/.ssdt/local-repo/[module]-[revision](-[classifier]).[ext]" |
36b2fd9e3861
fix handling of multi-project artifacts and local repos
smith@nwoca.org
parents:
80
diff
changeset
|
60 descriptor = 'optional' |
36b2fd9e3861
fix handling of multi-project artifacts and local repos
smith@nwoca.org
parents:
80
diff
changeset
|
61 checkmodified = true |
36b2fd9e3861
fix handling of multi-project artifacts and local repos
smith@nwoca.org
parents:
80
diff
changeset
|
62 } |
79 | 63 } |
74 | 64 add(new org.apache.ivy.plugins.resolver.URLResolver()) { |
83 | 65 name = 'ssdt-snapshots' |
66 m2compatible = true | |
67 url = "${ssdtArtifactory}/ssdt-snapshots" | |
68 addArtifactPattern("${url}/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]") | |
69 addIvyPattern("${url}/[organization]/[module]/ivy-[revision].xml") | |
70 checkmodified = true | |
71 changingMatcher = 'regexp' | |
72 changingPattern = '.*SNAPSHOT' | |
74 | 73 } |
83 | 74 add(new org.apache.ivy.plugins.resolver.URLResolver()) { |
75 name = 'ssdt-releases' | |
76 m2compatible = false | |
77 url = "${ssdtArtifactory}/ssdt-releases" | |
78 addArtifactPattern("${url}/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]") | |
79 addIvyPattern("${url}/[organization]/[module]/ivy-[revision].xml") | |
74 | 80 } |
83 | 81 mavenRepo name: 'ssdt-repo', url: "${ssdtArtifactory}/ssdt-repo" |
75 | 82 |
83 } | |
81
36b2fd9e3861
fix handling of multi-project artifacts and local repos
smith@nwoca.org
parents:
80
diff
changeset
|
84 |
36b2fd9e3861
fix handling of multi-project artifacts and local repos
smith@nwoca.org
parents:
80
diff
changeset
|
85 if ( thisProject.repositories.find { it.name == 'local' } ) { |
87 | 86 uploadArchives { |
87 repositories { | |
88 add thisProject.repositories.local | |
89 } | |
90 } | |
85 | 91 |
87 | 92 thisProject.tasks.add("publishLocal") { |
93 description = "Publishes this projects artifacts to developer's local repository" | |
94 dependsOn = ["uploadArchives"] | |
95 } | |
75 | 96 } |
73 | 97 } |
98 } | |
99 } |