Skip to content

Commit

Permalink
Move values from AndroidManifest.xml to build.gradle
Browse files Browse the repository at this point in the history
Fix android-mvn-push.gradle
  • Loading branch information
cketti committed Jan 9, 2015
1 parent 242604f commit 01c82b9
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
5 changes: 2 additions & 3 deletions android-mvn-push.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ apply plugin: 'maven'
apply plugin: 'signing'

afterEvaluate { project ->
def android_manifest = new XmlParser(false, false).parseText(new File(project.projectDir, 'src/main/AndroidManifest.xml').getText())
project.version = android_manifest.'@android:versionName'
project.group = android_manifest.'@package'
project.version = android.defaultConfig.versionName
project.group = project.pom.group

uploadArchives {
repositories {
Expand Down
7 changes: 7 additions & 0 deletions ckChangeLog/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,17 @@ apply plugin: 'com.android.library'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
versionName "1.2.1"

minSdkVersion 4
}
}

project.ext {
pom = [
group: "de.cketti.library.changelog",
artifactId: "ckchangelog",
name: "ckChangeLog Library",
description: "An Android Library to display a Change Log",
Expand Down
8 changes: 1 addition & 7 deletions ckChangeLog/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.cketti.library.changelog"
android:versionName="1.2.1" >

<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="17" />
<manifest package="de.cketti.library.changelog">

<application/>

Expand Down
8 changes: 8 additions & 0 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
versionCode 1
versionName "1.0"

minSdkVersion 7
targetSdkVersion 17
}
}

dependencies {
Expand Down
10 changes: 2 additions & 8 deletions sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.cketti.sample.changelog"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="17" />
package="de.cketti.sample.changelog">

<application
android:allowBackup="true"
Expand All @@ -24,4 +18,4 @@
</activity>
</application>

</manifest>
</manifest>

0 comments on commit 01c82b9

Please sign in to comment.