comparison init.gradle @ 78:e47f80ef056b

finish cleanLocal. start adding artifactory plugin
author smith@nwoca.org
date Mon, 06 Feb 2012 18:40:34 -0500
parents e9605748e5ce
children f0c29c1ac1f4
comparison
equal deleted inserted replaced
77:e9605748e5ce 78:e47f80ef056b
8 8
9 subprojects { 9 subprojects {
10 10
11 task cleanLocal << { 11 task cleanLocal << {
12 def local = project.repositories.find { it.name == 'local' } 12 def local = project.repositories.find { it.name == 'local' }
13 println local
14 if ( local ) { 13 if ( local ) {
15 14 local.dirs.each {
15 logger.info "removing local repo: $it"
16 it.deleteDir()
17 }
16 } 18 }
19 }
20
21 cleanLocal.onlyIf {
22 project.repositories.find { it.name == 'local' }?.dirs.any { it.exists() }
17 } 23 }
18 24
19 task publishLocal(dependsOn: 'uploadArchives') << { println "published to local repository" } 25 task publishLocal(dependsOn: 'uploadArchives') << { println "published to local repository" }
20 26
21 } 27 }
22 28
23 29
24 class ArtifactoryGradleSettings extends BuildAdapter implements BuildListener { 30 class ArtifactoryGradleSettings extends BuildAdapter implements BuildListener {
25 31
32 def void projectsLoaded(Gradle gradle) {
33
34 Project root = gradle.getRootProject()
35
36 root.allprojects {
37 buildscript {
38 repositories {
39 mavenRepo name: 'plugins-repo', url: "http://repos.ssdt.nwoca.org/artifactory/gradle-plugins"
40 }
41 dependencies {
42 classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '2.0.10')
43 }
44 }
45 }
46 }
26 def void projectsEvaluated(Gradle gradle) { 47 def void projectsEvaluated(Gradle gradle) {
27 48
28 Project root = gradle.getRootProject() 49 Project root = gradle.getRootProject()
50
29 root.subprojects { 51 root.subprojects {
30 52
31 configurations.all { 53 configurations.all {
32 resolutionStrategy.cacheChangingModulesFor 120, 'minutes' 54 resolutionStrategy.cacheChangingModulesFor 120, 'minutes'
33 resolutionStrategy.cacheDynamicVersionsFor 120, 'minutes' 55 resolutionStrategy.cacheDynamicVersionsFor 120, 'minutes'
34 } 56 }
35 57
36 buildscript {
37 repositories {
38 mavenRepo name: 'plugins-repo', url: "http://repos.ssdt.nwoca.org/artifactory/gradle-plugins"
39 }
40 }
41
42 repositories { 58 repositories {
43 59
44 if (!gradle.bambooBuild) { 60 if (!gradle.bambooBuild) {
45 flatDir { 61 flatDir {
46 name "local" 62 name "local"