Skip to content

Commit

Permalink
Building with gradle, gradle-like structure
Browse files Browse the repository at this point in the history
  • Loading branch information
David Vávra committed Jan 2, 2014
1 parent d43c7f2 commit fe3e8ca
Show file tree
Hide file tree
Showing 39 changed files with 169 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ proguard-project.txt
#Gradle
library/build
library/.gradle
gradlew/
gradlew.bat
gradlew
gradle/
.gradle/

#Other
.DS_Store
Expand Down
24 changes: 24 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
buildscript {
repositories {
mavenCentral()
}

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

def isReleaseBuild() {
return version.contains("SNAPSHOT") == false
}

allprojects {
version = VERSION_NAME
group = GROUP

repositories {
mavenCentral()
}
}

apply plugin: 'android-reporting'
14 changes: 14 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
VERSION_NAME=1.1.2
VERSION_CODE=3
GROUP=eu.inmite.android.lib

POM_DESCRIPTION=Android library for creating styleable dialogs easily
POM_URL=https://github.com/inmite/android-styled-dialogs
POM_SCM_URL=https://github.com/inmite/android-styled-dialogs
POM_SCM_CONNECTION=scm:[email protected]:inmite/android-styled-dialogs.git
POM_SCM_DEV_CONNECTION=scm:[email protected]:inmite/android-styled-dialogs.git
POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID[email protected]
POM_DEVELOPER_NAME=David Vavra
32 changes: 32 additions & 0 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.7.+'
}
}
apply plugin: 'android-library'

repositories {
mavenCentral()
}

android {
compileSdkVersion 19
buildToolsVersion "19.0.0"

defaultConfig {
minSdkVersion 7
targetSdkVersion 19
versionName project.VERSION_NAME
versionCode Integer.parseInt(project.VERSION_CODE)
}
}

dependencies {
compile 'com.android.support:support-v4:+'
}

// Used to push in maven
apply from: '../maven_push.gradle'
3 changes: 3 additions & 0 deletions library/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POM_NAME=StyledDialogs for Android
POM_ARTIFACT_ID=android-styled-dialogs
POM_PACKAGING=aar
11 changes: 8 additions & 3 deletions library/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>

<artifactId>android-styled-dialogs</artifactId>
<packaging>aar</packaging>
<packaging>apklib</packaging>

<name>Android StyledDialogs library</name>
<description>This library makes styling dialogs easy. They are compatible with Holo design and Android Design
Expand Down Expand Up @@ -57,19 +57,24 @@
<dependency>
<groupId>com.google.android</groupId>
<artifactId>support-v4</artifactId>
<scope>provided</scope>
</dependency>

</dependencies>

<build>
<sourceDirectory>src</sourceDirectory>
<sourceDirectory>src/main/java</sourceDirectory>

<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<lazyLibraryUnpack>true</lazyLibraryUnpack>
<androidManifestFile>${project.basedir}/src/main/AndroidManifest.xml</androidManifestFile>
<resourceDirectory>${project.basedir}/src/main/res</resourceDirectory>
<assetsDirectory>${project.basedir}/src/main/assets</assetsDirectory>
</configuration>
</plugin>

<plugin>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
82 changes: 82 additions & 0 deletions maven_push.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
apply plugin: 'maven'
apply plugin: 'signing'

def sonatypeRepositoryUrl
if (isReleaseBuild()) {
println 'RELEASE BUILD'
sonatypeRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
} else {
println 'DEBUG BUILD'
sonatypeRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
}

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

pom.artifactId = POM_ARTIFACT_ID

repository(url: sonatypeRepositoryUrl) {
authentication(userName: nexusUsername, password: nexusPassword)
}

pom.project {
name POM_NAME
packaging POM_PACKAGING
description POM_DESCRIPTION
url POM_URL

scm {
url POM_SCM_URL
connection POM_SCM_CONNECTION
developerConnection POM_SCM_DEV_CONNECTION
}

licenses {
license {
name POM_LICENCE_NAME
url POM_LICENCE_URL
distribution POM_LICENCE_DIST
}
}

developers {
developer {
id POM_DEVELOPER_ID
name POM_DEVELOPER_NAME
}
}
}
}
}
}

signing {
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}

task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.allJava
}

task androidJavadocsJar(type: Jar) {
classifier = 'javadoc'
//basename = artifact_id
from androidJavadocs.destinationDir
}

task androidSourcesJar(type: Jar) {
classifier = 'sources'
//basename = artifact_id
from android.sourceSets.main.allSource
}

artifacts {
//archives packageReleaseJar
archives androidSourcesJar
archives androidJavadocsJar
}
}
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include 'library'

0 comments on commit fe3e8ca

Please sign in to comment.