Mercurial > public > develkit
view 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 |
line wrap: on
line source
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" subprojects { task cleanLocal << { def local = project.repositories.find { it.name == 'local' } if ( local ) { local.dirs.each { logger.info "removing local repo: $it" 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() 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 url = 'http://repos.ssdt.nwoca.org/artifactory/ssdt-snapshots' addArtifactPattern('http://repos.ssdt.nwoca.org/artifactory/ssdt-snapshots/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]') addIvyPattern('http://repos.ssdt.nwoca.org/artifactory/ssdt-snapshots/[organization]/[module]/ivy-[revision].xml') checkmodified = true changingMatcher = 'regexp' changingPattern = '.*SNAPSHOT' } add(new org.apache.ivy.plugins.resolver.URLResolver()) { name = 'ssdt-releases' m2compatible = false url = 'http://repos.ssdt.nwoca.org/artifactory/ssdt-releases' addArtifactPattern('http://repos.ssdt.nwoca.org/artifactory/ssdt-releases/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]') addIvyPattern('http://repos.ssdt.nwoca.org/artifactory/ssdt-releases/[organization]/[module]/ivy-[revision].xml') } mavenRepo name: 'ssdt-repo', url: 'http://repos.ssdt.nwoca.org/artifactory/ssdt-repo' } uploadArchives { repositories { if ( project.repositories.find { it.name == 'local' } ) { add project.repositories.local } } } } } }