diff --git a/build.gradle b/build.gradle index 2e5e0e5..11160db 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,9 @@ buildscript { repositories { mavenCentral() mavenLocal() + maven { + url uri(mavenDownloadServer + mavenRepo + mavenReleases) + } } dependencies { @@ -14,11 +17,6 @@ allprojects { apply plugin: 'maven' apply plugin: 'maven-publish' - repositories { - mavenCentral() - mavenLocal() - } - configurations { deployerJars } @@ -26,6 +24,20 @@ allprojects { dependencies { deployerJars "org.kuali.maven.wagons:maven-s3-wagon:1.1.20" } + + repositories { + mavenCentral() + mavenLocal() + maven { + name 'aviary-release' + url uri(mavenDownloadServer + mavenRepo + mavenReleases) + } + + maven { + name 'aviary-snapshot' + url uri(mavenDownloadServer + mavenRepo + mavenSnapshot) + } + } } task wrapper(type: Wrapper) { diff --git a/gradle.properties b/gradle.properties index a1e3e7a..603c24e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,6 @@ // aviary maven repo -mavenUploadServer= +mavenUploadServer=s3://maven.aviary.com mavenDownloadServer=http://maven.aviary.com mavenRepo=/repo mavenReleases=/release -mavenSnapshot=/snapshot -mavenUsername= -mavenPassword= \ No newline at end of file +mavenSnapshot=/snapshot \ No newline at end of file diff --git a/imageviewzoom/build.gradle b/imageviewzoom/build.gradle index 3b5dde1..0d38a72 100644 --- a/imageviewzoom/build.gradle +++ b/imageviewzoom/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'android-library' group 'it.sephiroth.android.library.imageviewzoom' -version '1.0.0' +version '1.0.0'+gradle.ext.versionModifier android { compileSdkVersion 19 @@ -88,9 +88,14 @@ def generatePom() { } repositories { - repository { - id 's3.release' - url 'http://maven.aviary.com/repo/release' + project.repositories.each { repo -> + + if (repo.name != 'MavenRepo' && repo.name != 'MavenLocal' && !repo.url.toString().startsWith('file:/') ) { + repository { + id = repo.name + url = repo.url + } + } } } } @@ -107,17 +112,29 @@ task writePom { } uploadArchives { - doFirst { - repositories.mavenDeployer.pom = generatePom() - } - repositories { - mavenDeployer { - configuration = configurations.deployerJars + if( project.hasProperty('username') && project.hasProperty('password')) { - repository(url: mavenUploadServer + mavenRepo + mavenReleases){ - authentication(userName: mavenUsername, password: mavenPassword) + + mavenDeployer { + pom = generatePom() + configuration = configurations.deployerJars + + repository(url: mavenUploadServer + mavenRepo + mavenReleases){ + authentication(userName: username, password: password) + } + + snapshotRepository(url: mavenUploadServer + mavenRepo + mavenSnapshot){ + authentication(userName: username, password: password) + } } + } else { + } + } + + doLast { + if( !project.hasProperty('username') || !project.hasProperty('password')) { + logger.error '\tError: Cannot upload artifacts, username and password missing' } } } @@ -147,13 +164,13 @@ task updateVersion { println "Version mismatch. updating version to ${project.version}" def text = src.text - def pattern = /(?ms)^(\s*)(public static final String VERSION = ")([0-9\.]+)(";)$/ + def pattern = /(?ms)^(\s*)(public static final String VERSION = ")([0-9\-a-zA-Z\.]+)(";)$/ def matcher = ( text =~ pattern ) if( matcher.size() > 0 ) { text = matcher.replaceFirst("\$1\$2" + project.version + "\$4") src.setText(text) - println "Updated version of AviaryCds.java to ${project.version}" + println "Updated version of ImageViewTouchBase.java to ${project.version}" } } diff --git a/imageviewzoom/pom.xml b/imageviewzoom/pom.xml index 20af27d..f878853 100644 --- a/imageviewzoom/pom.xml +++ b/imageviewzoom/pom.xml @@ -4,7 +4,7 @@ 4.0.0 it.sephiroth.android.library.imageviewzoom imageviewzoom - 1.0.0 + 1.0.0-SNAPSHOT Android ImageView widget with zoom and pan capabilities https://github.com/sephiroth74/ImageViewZoom 2012 @@ -34,8 +34,24 @@ - s3.release + aviary-release http://maven.aviary.com/repo/release + + aviary-snapshot + http://maven.aviary.com/repo/snapshot + + + MavenRepo2 + http://repo1.maven.org/maven2/ + + + aviary-release2 + http://maven.aviary.com/repo/release + + + aviary-snapshot2 + http://maven.aviary.com/repo/snapshot + diff --git a/imageviewzoom/src/it/sephiroth/android/library/imagezoom/ImageViewTouchBase.java b/imageviewzoom/src/it/sephiroth/android/library/imagezoom/ImageViewTouchBase.java index c996558..5df50e8 100644 --- a/imageviewzoom/src/it/sephiroth/android/library/imagezoom/ImageViewTouchBase.java +++ b/imageviewzoom/src/it/sephiroth/android/library/imagezoom/ImageViewTouchBase.java @@ -24,7 +24,7 @@ */ public abstract class ImageViewTouchBase extends ImageView implements IDisposable { - public static final String VERSION = "1.0.0"; + public static final String VERSION = "1.0.0-SNAPSHOT"; public interface OnDrawableChangeListener { diff --git a/settings.gradle b/settings.gradle index ad6020c..67c2de0 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,4 +1,6 @@ rootProject.name = 'imageviewzoom' +gradle.ext.versionModifier = '-SNAPSHOT' + include ':imageviewzoom' include ':demo' \ No newline at end of file