Mercurial > public > develkit
comparison init.gradle @ 75:02cc8e50945e
allow local file repo for local builds
author | smith@nwoca.org |
---|---|
date | Sun, 05 Feb 2012 15:44:08 -0500 |
parents | a622ec40a570 |
children | 15a5fd89d80b |
comparison
equal
deleted
inserted
replaced
74:a622ec40a570 | 75:02cc8e50945e |
---|---|
1 | 1 |
2 logger.debug("applying SSDT artifactory Gradle Settings") | 2 logger.debug("applying SSDT artifactory Gradle Settings") |
3 | 3 |
4 gradle.addListener(new ArtifactoryGradleSettings()) | 4 gradle.addListener(new ArtifactoryGradleSettings()) |
5 | 5 |
6 subprojects { | |
7 | |
8 task cleanLocal << { | |
9 def local = project.repositories.find { it.name == 'local' } | |
10 println local | |
11 if ( local ) { | |
12 | |
13 } | |
14 } | |
15 | |
16 task publishLocal(dependsOn: 'uploadArchives') << { println "published to local repository" } | |
17 | |
18 } | |
19 | |
20 | |
6 class ArtifactoryGradleSettings extends BuildAdapter implements BuildListener { | 21 class ArtifactoryGradleSettings extends BuildAdapter implements BuildListener { |
7 | 22 |
8 def void projectsEvaluated(Gradle gradle) { | 23 def void projectsEvaluated(Gradle gradle) { |
9 | 24 |
10 | |
11 Project root = gradle.getRootProject() | 25 Project root = gradle.getRootProject() |
12 root.allprojects { | 26 root.subprojects { |
13 | 27 |
14 configurations.all { | 28 configurations.all { |
15 resolutionStrategy.cacheChangingModulesFor 120, 'minutes' | 29 resolutionStrategy.cacheChangingModulesFor 120, 'minutes' |
16 resolutionStrategy.cacheDynamicVersionsFor 120, 'minutes' | 30 resolutionStrategy.cacheDynamicVersionsFor 120, 'minutes' |
17 } | 31 } |
19 buildscript { | 33 buildscript { |
20 repositories { | 34 repositories { |
21 mavenRepo name: 'plugins-repo', url: "http://repos.ssdt.nwoca.org/artifactory/gradle-plugins" | 35 mavenRepo name: 'plugins-repo', url: "http://repos.ssdt.nwoca.org/artifactory/gradle-plugins" |
22 } | 36 } |
23 } | 37 } |
24 | 38 |
25 repositories { | 39 repositories { |
26 | 40 |
41 flatDir { | |
42 name "local" | |
43 dirs System.properties['user.home'] + "/.ssdt/local-repo" | |
44 } | |
45 | |
27 add(new org.apache.ivy.plugins.resolver.URLResolver()) { | 46 add(new org.apache.ivy.plugins.resolver.URLResolver()) { |
28 name = 'ssdt-snapshots' | 47 name = 'ssdt-snapshots' |
29 m2compatible = true | 48 m2compatible = true |
30 url = 'http://repos.ssdt.nwoca.org/artifactory/ssdt-snapshots' | 49 url = 'http://repos.ssdt.nwoca.org/artifactory/ssdt-snapshots' |
31 addArtifactPattern('http://repos.ssdt.nwoca.org/artifactory/ssdt-snapshots/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]') | 50 addArtifactPattern('http://repos.ssdt.nwoca.org/artifactory/ssdt-snapshots/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]') |
40 url = 'http://repos.ssdt.nwoca.org/artifactory/ssdt-releases' | 59 url = 'http://repos.ssdt.nwoca.org/artifactory/ssdt-releases' |
41 addArtifactPattern('http://repos.ssdt.nwoca.org/artifactory/ssdt-releases/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]') | 60 addArtifactPattern('http://repos.ssdt.nwoca.org/artifactory/ssdt-releases/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]') |
42 addIvyPattern('http://repos.ssdt.nwoca.org/artifactory/ssdt-releases/[organization]/[module]/ivy-[revision].xml') | 61 addIvyPattern('http://repos.ssdt.nwoca.org/artifactory/ssdt-releases/[organization]/[module]/ivy-[revision].xml') |
43 } | 62 } |
44 mavenRepo name: 'ssdt-repo', url: 'http://repos.ssdt.nwoca.org/artifactory/ssdt-repo' | 63 mavenRepo name: 'ssdt-repo', url: 'http://repos.ssdt.nwoca.org/artifactory/ssdt-repo' |
45 } | 64 |
65 } | |
66 | |
67 uploadArchives { | |
68 repositories { | |
69 if ( project.repositories.find { it.name == 'local' } ) { | |
70 add project.repositories.local | |
71 } | |
72 } | |
73 } | |
46 } | 74 } |
47 } | 75 } |
48 } | 76 } |