annotate 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
rev   line source
73
174b4bcfd2f2 fix gradle init script
smith@nwoca.org
parents:
diff changeset
1
74
a622ec40a570 update repo definitions
smith@nwoca.org
parents: 73
diff changeset
2 logger.debug("applying SSDT artifactory Gradle Settings")
73
174b4bcfd2f2 fix gradle init script
smith@nwoca.org
parents:
diff changeset
3
174b4bcfd2f2 fix gradle init script
smith@nwoca.org
parents:
diff changeset
4 gradle.addListener(new ArtifactoryGradleSettings())
174b4bcfd2f2 fix gradle init script
smith@nwoca.org
parents:
diff changeset
5
75
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
6 subprojects {
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
7
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
8 task cleanLocal << {
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
9 def local = project.repositories.find { it.name == 'local' }
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
10 println local
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
11 if ( local ) {
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
12
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
13 }
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
14 }
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
15
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
16 task publishLocal(dependsOn: 'uploadArchives') << { println "published to local repository" }
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
17
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
18 }
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
19
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
20
73
174b4bcfd2f2 fix gradle init script
smith@nwoca.org
parents:
diff changeset
21 class ArtifactoryGradleSettings extends BuildAdapter implements BuildListener {
174b4bcfd2f2 fix gradle init script
smith@nwoca.org
parents:
diff changeset
22
174b4bcfd2f2 fix gradle init script
smith@nwoca.org
parents:
diff changeset
23 def void projectsEvaluated(Gradle gradle) {
75
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
24
73
174b4bcfd2f2 fix gradle init script
smith@nwoca.org
parents:
diff changeset
25 Project root = gradle.getRootProject()
75
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
26 root.subprojects {
74
a622ec40a570 update repo definitions
smith@nwoca.org
parents: 73
diff changeset
27
a622ec40a570 update repo definitions
smith@nwoca.org
parents: 73
diff changeset
28 configurations.all {
a622ec40a570 update repo definitions
smith@nwoca.org
parents: 73
diff changeset
29 resolutionStrategy.cacheChangingModulesFor 120, 'minutes'
a622ec40a570 update repo definitions
smith@nwoca.org
parents: 73
diff changeset
30 resolutionStrategy.cacheDynamicVersionsFor 120, 'minutes'
a622ec40a570 update repo definitions
smith@nwoca.org
parents: 73
diff changeset
31 }
a622ec40a570 update repo definitions
smith@nwoca.org
parents: 73
diff changeset
32
73
174b4bcfd2f2 fix gradle init script
smith@nwoca.org
parents:
diff changeset
33 buildscript {
174b4bcfd2f2 fix gradle init script
smith@nwoca.org
parents:
diff changeset
34 repositories {
174b4bcfd2f2 fix gradle init script
smith@nwoca.org
parents:
diff changeset
35 mavenRepo name: 'plugins-repo', url: "http://repos.ssdt.nwoca.org/artifactory/gradle-plugins"
174b4bcfd2f2 fix gradle init script
smith@nwoca.org
parents:
diff changeset
36 }
174b4bcfd2f2 fix gradle init script
smith@nwoca.org
parents:
diff changeset
37 }
75
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
38
73
174b4bcfd2f2 fix gradle init script
smith@nwoca.org
parents:
diff changeset
39 repositories {
74
a622ec40a570 update repo definitions
smith@nwoca.org
parents: 73
diff changeset
40
75
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
41 flatDir {
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
42 name "local"
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
43 dirs System.properties['user.home'] + "/.ssdt/local-repo"
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
44 }
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
45
74
a622ec40a570 update repo definitions
smith@nwoca.org
parents: 73
diff changeset
46 add(new org.apache.ivy.plugins.resolver.URLResolver()) {
a622ec40a570 update repo definitions
smith@nwoca.org
parents: 73
diff changeset
47 name = 'ssdt-snapshots'
a622ec40a570 update repo definitions
smith@nwoca.org
parents: 73
diff changeset
48 m2compatible = true
a622ec40a570 update repo definitions
smith@nwoca.org
parents: 73
diff changeset
49 url = 'http://repos.ssdt.nwoca.org/artifactory/ssdt-snapshots'
a622ec40a570 update repo definitions
smith@nwoca.org
parents: 73
diff changeset
50 addArtifactPattern('http://repos.ssdt.nwoca.org/artifactory/ssdt-snapshots/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]')
a622ec40a570 update repo definitions
smith@nwoca.org
parents: 73
diff changeset
51 addIvyPattern('http://repos.ssdt.nwoca.org/artifactory/ssdt-snapshots/[organization]/[module]/ivy-[revision].xml')
a622ec40a570 update repo definitions
smith@nwoca.org
parents: 73
diff changeset
52 checkmodified = true
a622ec40a570 update repo definitions
smith@nwoca.org
parents: 73
diff changeset
53 changingMatcher = 'regexp'
a622ec40a570 update repo definitions
smith@nwoca.org
parents: 73
diff changeset
54 changingPattern = '.*SNAPSHOT'
a622ec40a570 update repo definitions
smith@nwoca.org
parents: 73
diff changeset
55 }
a622ec40a570 update repo definitions
smith@nwoca.org
parents: 73
diff changeset
56 add(new org.apache.ivy.plugins.resolver.URLResolver()) {
a622ec40a570 update repo definitions
smith@nwoca.org
parents: 73
diff changeset
57 name = 'ssdt-releases'
a622ec40a570 update repo definitions
smith@nwoca.org
parents: 73
diff changeset
58 m2compatible = false
a622ec40a570 update repo definitions
smith@nwoca.org
parents: 73
diff changeset
59 url = 'http://repos.ssdt.nwoca.org/artifactory/ssdt-releases'
a622ec40a570 update repo definitions
smith@nwoca.org
parents: 73
diff changeset
60 addArtifactPattern('http://repos.ssdt.nwoca.org/artifactory/ssdt-releases/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]')
a622ec40a570 update repo definitions
smith@nwoca.org
parents: 73
diff changeset
61 addIvyPattern('http://repos.ssdt.nwoca.org/artifactory/ssdt-releases/[organization]/[module]/ivy-[revision].xml')
a622ec40a570 update repo definitions
smith@nwoca.org
parents: 73
diff changeset
62 }
73
174b4bcfd2f2 fix gradle init script
smith@nwoca.org
parents:
diff changeset
63 mavenRepo name: 'ssdt-repo', url: 'http://repos.ssdt.nwoca.org/artifactory/ssdt-repo'
75
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
64
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
65 }
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
66
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
67 uploadArchives {
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
68 repositories {
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
69 if ( project.repositories.find { it.name == 'local' } ) {
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
70 add project.repositories.local
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
71 }
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
72 }
02cc8e50945e allow local file repo for local builds
smith@nwoca.org
parents: 74
diff changeset
73 }
73
174b4bcfd2f2 fix gradle init script
smith@nwoca.org
parents:
diff changeset
74 }
174b4bcfd2f2 fix gradle init script
smith@nwoca.org
parents:
diff changeset
75 }
174b4bcfd2f2 fix gradle init script
smith@nwoca.org
parents:
diff changeset
76 }