comparison init.gradle @ 85:f36eeb411845

add sonar publishing
author smith@nwoca.org
date Tue, 14 Feb 2012 15:18:45 -0500
parents fa7b349201eb
children be111b66cdc6
comparison
equal deleted inserted replaced
84:fa7b349201eb 85:f36eeb411845
1 1
2 gradle.addListener(new ArtifactoryGradleSettings()) 2 gradle.addListener(new ArtifactoryGradleSettings())
3
3 4
4 gradle.bambooBuild = System.getenv().any { it.key.startsWith('BAMBOO')} 5 gradle.bambooBuild = System.getenv().any { it.key.startsWith('BAMBOO')}
5 logger.info "applying SSDT artifactory Gradle Settings (bamboo: $gradle.bambooBuild)" 6 logger.info "applying SSDT artifactory Gradle Settings (bamboo: $gradle.bambooBuild)"
6 7
7 if (gradle.bambooBuild) { 8 if (gradle.bambooBuild) {
8 apply from: "${gradle.hasProperty('ssdtGradlekitLocation') ? gradle.ssdtGradlekitLocation :'http://hg.ssdt-ohio.org/ssdt/gradlekit/raw-file/tip'}/artifactory.gradle" 9 gradle.ssdtGradlekitLocation = gradle.hasProperty('ssdtGradlekitLocation') ? gradle.ssdtGradlekitLocation : 'http://hg.ssdt-ohio.org/ssdt/gradlekit/raw-file/tip'
10 apply from: "${gradle.ssdtGradlekitLocation}/artifactory.gradle"
9 } 11 }
12
13
14 apply from: "${gradle.ssdtDevelkitLocation}/metrics.gradle"
10 15
11 task wrapper(type: Wrapper) { 16 task wrapper(type: Wrapper) {
12 gradleVersion = '1.0-milestone-7' 17 gradleVersion = '1.0-milestone-7'
13 } 18 }
14 19
16 // patch wrapper path for 1.0-milestone-7 (http://issues.gradle.org/browse/GRADLE-1823) 21 // 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') 22 ant.replace(file: 'gradlew', token: '\\wrapper\\gradle-wrapper.jar',value:'/wrapper/gradle-wrapper.jar')
18 } 23 }
19 24
20 allprojects { 25 allprojects {
26
21 task cleanLocal(description: "removes all artifacts from developer's local repository") << { 27 task cleanLocal(description: "removes all artifacts from developer's local repository") << {
22 28
23 def local = project.repositories.find { it.name == 'local' } 29 def local = project.repositories.find { it.name == 'local' }
24 if ( local ) { 30 if ( local ) {
25 logger.info "removing local repo: $it" 31 logger.info "removing local repo: $it"
26 new File(System.properties['user.home'] + "/.ssdt/local-repo").deleteDir() 32 new File(System.properties['user.home'] + "/.ssdt/local-repo").deleteDir()
27 } 33 }
28 } 34 }
35
29 cleanLocal.onlyIf { 36 cleanLocal.onlyIf {
30 project.repositories.any { it.name == 'local' } 37 project.repositories.any { it.name == 'local' }
31 } 38 }
32 task publishLocal(dependsOn: 'uploadArchives') {
33 description = "Publishes this projects artifacts to developer's local repository"
34 }
35 39
36 } 40 }
37 41
38 class ArtifactoryGradleSettings extends BuildAdapter implements BuildListener { 42 class ArtifactoryGradleSettings extends BuildAdapter implements BuildListener {
39 43
76 mavenRepo name: 'ssdt-repo', url: "${ssdtArtifactory}/ssdt-repo" 80 mavenRepo name: 'ssdt-repo', url: "${ssdtArtifactory}/ssdt-repo"
77 81
78 } 82 }
79 83
80 if ( thisProject.repositories.find { it.name == 'local' } ) { 84 if ( thisProject.repositories.find { it.name == 'local' } ) {
81 uploadArchives { 85 // uploadArchives {
82 repositories { 86 // repositories {
83 add thisProject.repositories.local 87 // add thisProject.repositories.local
84 } 88 // }
85 } 89 // }
90
91 // task publishLocal(dependsOn: 'uploadArchives') {
92 // description = "Publishes this projects artifacts to developer's local repository"
93 // }
94
86 } 95 }
87 } 96 }
88 } 97 }
89 } 98 }