Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made joda-convert optional #57

Merged
merged 1 commit into from
Jun 2, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,20 @@ public class MyApp extends Application {
}
```

Known Issues
============
Joda-Convert and Proguard
=========================

If you are using versions of the Android Gradle plugin previous to 1.3, you may need to exclude some files for
packaging to work properly:
Joda-time classes optionally support [joda-convert](http://www.joda.org/joda-convert/).

**If you do not include joda-convert in your builds and you use Proguard**, you will have to tell Proguard to ignore any
issues where joda-convert is optionally referenced:

```
-dontwarn org.joda.convert.FromString
-dontwarn org.joda.convert.ToString
```

**If you include joda-convert in your builds**, you will need to use `packagingOptions` to prevent build issues:

```groovy
android {
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0-beta1'
classpath 'com.android.tools.build:gradle:1.2.3'
}
}

Expand Down
6 changes: 0 additions & 6 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ android {
lintOptions {
lintConfig file('lint.xml')
}

packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}

apply from: 'gradle-mvn-push.gradle'
Expand All @@ -35,7 +30,6 @@ configurations {

dependencies {
compile 'joda-time:joda-time:2.8:no-tzdb'
compile 'org.joda:joda-convert:1.2'
updateTzData 'joda-time:joda-time:2.8'
}

Expand Down
2 changes: 1 addition & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {
minSdkVersion 9
targetSdkVersion 22

proguardFiles getDefaultProguardFile('proguard-android.txt')
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'config.pro'
}

// We're enabling proguard just to prove we don't have to do anything
Expand Down
3 changes: 3 additions & 0 deletions sample/config.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Proguard configuration if not including joda-convert
-dontwarn org.joda.convert.FromString
-dontwarn org.joda.convert.ToString