Skip to content

Commit

Permalink
gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
sephiroth74 committed Nov 20, 2013
1 parent b8afbd4 commit f178a29
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 26 deletions.
22 changes: 17 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ buildscript {
repositories {
mavenCentral()
mavenLocal()
maven {
url uri(mavenDownloadServer + mavenRepo + mavenReleases)
}
}

dependencies {
Expand All @@ -14,18 +17,27 @@ allprojects {
apply plugin: 'maven'
apply plugin: 'maven-publish'

repositories {
mavenCentral()
mavenLocal()
}

configurations {
deployerJars
}

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) {
Expand Down
6 changes: 2 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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=
mavenSnapshot=/snapshot
45 changes: 31 additions & 14 deletions imageviewzoom/build.gradle
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
}
}
}
}
}
Expand All @@ -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'
}
}
}
Expand Down Expand Up @@ -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}"
}

}
Expand Down
20 changes: 18 additions & 2 deletions imageviewzoom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>it.sephiroth.android.library.imageviewzoom</groupId>
<artifactId>imageviewzoom</artifactId>
<version>1.0.0</version>
<version>1.0.0-SNAPSHOT</version>
<description>Android ImageView widget with zoom and pan capabilities</description>
<url>https://github.com/sephiroth74/ImageViewZoom</url>
<inceptionYear>2012</inceptionYear>
Expand Down Expand Up @@ -34,8 +34,24 @@
</scm>
<repositories>
<repository>
<id>s3.release</id>
<id>aviary-release</id>
<url>http://maven.aviary.com/repo/release</url>
</repository>
<repository>
<id>aviary-snapshot</id>
<url>http://maven.aviary.com/repo/snapshot</url>
</repository>
<repository>
<id>MavenRepo2</id>
<url>http://repo1.maven.org/maven2/</url>
</repository>
<repository>
<id>aviary-release2</id>
<url>http://maven.aviary.com/repo/release</url>
</repository>
<repository>
<id>aviary-snapshot2</id>
<url>http://maven.aviary.com/repo/snapshot</url>
</repository>
</repositories>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
2 changes: 2 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
rootProject.name = 'imageviewzoom'

gradle.ext.versionModifier = '-SNAPSHOT'

include ':imageviewzoom'
include ':demo'

0 comments on commit f178a29

Please sign in to comment.