# HG changeset patch # User smith@nwoca.org # Date 1328671313 18000 # Node ID f0c29c1ac1f4bbcbf585c4e8b5567bf710778847 # Parent e47f80ef056beff414040f7359f4a67890bc5fee finish gradle to artifactory publishing diff -r e47f80ef056b -r f0c29c1ac1f4 init.gradle --- a/init.gradle Mon Feb 06 18:40:34 2012 -0500 +++ b/init.gradle Tue Feb 07 22:21:53 2012 -0500 @@ -1,13 +1,15 @@ -logger.debug("applying SSDT artifactory Gradle Settings") gradle.addListener(new ArtifactoryGradleSettings()) gradle.bambooBuild = System.getenv().any { it.key.startsWith('BAMBOO')} -logger.info "bamboo build: $gradle.bambooBuild" +logger.info "applying SSDT artifactory Gradle Settings (bamboo: $gradle.bambooBuild)" + +if (gradle.bambooBuild) { + apply from: "${gradle.hasProperty('ssdtGradlekitLocation') ? gradle.ssdtGradlekitLocation :'http://hg.ssdt-ohio.org/browse/ssdt/gradlekit'}/artifactory.gradle" +} subprojects { - task cleanLocal << { def local = project.repositories.find { it.name == 'local' } if ( local ) { @@ -16,54 +18,31 @@ it.deleteDir() } } - } - + } cleanLocal.onlyIf { project.repositories.find { it.name == 'local' }?.dirs.any { it.exists() } - } - + } task publishLocal(dependsOn: 'uploadArchives') << { println "published to local repository" } - } - class ArtifactoryGradleSettings extends BuildAdapter implements BuildListener { - - def void projectsLoaded(Gradle gradle) { - - Project root = gradle.getRootProject() - - root.allprojects { - buildscript { - repositories { - mavenRepo name: 'plugins-repo', url: "http://repos.ssdt.nwoca.org/artifactory/gradle-plugins" - } - dependencies { - classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '2.0.10') - } - } - } - } + def void projectsEvaluated(Gradle gradle) { - Project root = gradle.getRootProject() - + Project root = gradle.getRootProject() root.subprojects { configurations.all { resolutionStrategy.cacheChangingModulesFor 120, 'minutes' resolutionStrategy.cacheDynamicVersionsFor 120, 'minutes' - } - + } repositories { - if (!gradle.bambooBuild) { flatDir { name "local" dirs System.properties['user.home'] + "/.ssdt/local-repo" } - } - + } add(new org.apache.ivy.plugins.resolver.URLResolver()) { name = 'ssdt-snapshots' m2compatible = true