Skip to content

Commit

Permalink
prepare for gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
ened committed Oct 1, 2013
1 parent 689da73 commit ab1071c
Show file tree
Hide file tree
Showing 16 changed files with 587 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ gen/

# Local configuration file (sdk path, etc)
local.properties

*.iml
.gradle
.idea
build
12 changes: 12 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
buildscript {
repositories {
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
classpath 'com.github.townsfolk:gradle-release:1.2'
}
}

apply plugin: 'release'
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version=1.0
5 changes: 5 additions & 0 deletions library/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="asia.ivity.android.marqueeview"
android:versionCode="1"
android:versionName="1.0"/>
128 changes: 128 additions & 0 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
buildscript {
repositories {
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}

apply plugin: 'android-library'
apply plugin: 'maven'
apply plugin: 'signing'

archivesBaseName = 'marqueeview'
group = 'asia.ivity.android'

dependencies {
/* compile 'com.google.android.gms:play-services:3.1.36+'*/
}

android {
compileSdkVersion 18
buildToolsVersion "18.0.1"

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}

// TODO: Add a task that prints the test results.
task instrumentTest(dependsOn: connectedCheck)

task apklib(type: Zip) {
dependsOn 'packageReleaseJar'
appendix = extension = 'apklib'

from 'AndroidManifest.xml'
into('res') {
from 'res'
}
into('src') {
from 'src'
}
}

artifacts {
archives apklib
}

signing {
sign configurations.archives
}

if (!hasProperty("sonatypeUsername")) {
sonatypeUsername = ""
}
if (!hasProperty("sonatypePassword")) {
sonatypePassword = ""
}

uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2') {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}

modifyPom(addFilter('aar') { artifact, file ->
artifact.name == 'marqueeview'
})

modifyPom(addFilter('apklib') { artifact, file ->
artifact.name == 'marqueeview-apklib'
})

// There's no official apklib for Google Play services, so we
// can't really maintain that dependency for the apklib packaging.
pom('apklib').whenConfigured { pom ->
pom.dependencies = []
}
}
}
}

def modifyPom(pom) {
pom.project {
name 'MarqueeView'
description 'Extensive library for customized marquee effect.'
url 'https://github.com/ened/Android-MarqueeView/compare'

scm {
url 'https://github.com/ened/Android-MarqueeView.git'
connection '[email protected]:ened/Android-MarqueeView.git'
developerConnection '[email protected]:ened/Android-MarqueeView.git'
}

licenses {
license {
name 'BSD License'
url 'http://opensource.org/licenses/bsd-license.php'
distribution 'repo'
}
}

organization {
name 'Ivity Asia'
url 'http://www.ivity.asia'
}

developers {
developer {
id 'ened'
name 'Sebastian Roth'
url 'http://www.sebroth.com'
}
}
}
}
Loading

0 comments on commit ab1071c

Please sign in to comment.