Skip to content

Add ProGuard section to README #617

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

Closed

Conversation

hermanliang
Copy link
Contributor

No description provided.

@rogerhu
Copy link
Contributor

rogerhu commented Mar 30, 2017

I'd just add it here:

https://github.com/ParsePlatform/Parse-SDK-Android/blob/master/Parse/release-proguard.pro

It should be pulled in automatically.

@hermanliang
Copy link
Contributor Author

It seems necessary when installing SDK in gradle

android {
    ...
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
  ...
  compile 'com.parse:parse-android:1.14.1'
}

then run

./gradlew assembleRelease

BUILD FAILED unless I add the rule

@rogerhu
Copy link
Contributor

rogerhu commented Mar 31, 2017

Correct but adding it the proguard file should include it with the lib

https://github.com/codepath/android_guides/wiki/Building-your-own-Android-library#using-with-proguard

@hermanliang
Copy link
Contributor Author

Does it due to SDK release jar not aar?

@rogerhu
Copy link
Contributor

rogerhu commented Apr 3, 2017

We release both. There is already a ProGuard file though...Are you saying it gets ignored for you if you were to add this line and use jetpack.io to confirm?

@Jawnnypoo
Copy link
Member

Yeah, this is probably needed now, since we have a hard dependency now on OkHttp

https://github.com/square/okhttp#proguard

@rogerhu
Copy link
Contributor

rogerhu commented Apr 3, 2017

I understand that part the question is whether we can just add it to https://github.com/ParsePlatform/Parse-SDK-Android/blob/master/Parse/release-proguard.pro.

Otherwise we should update the docs to include all the ProGuard lines listed there.

@Jawnnypoo
Copy link
Member

Ah yeah, my bad. Yes, we can just add it there, should fix the issue.

@rogerhu
Copy link
Contributor

rogerhu commented Apr 3, 2017

I guess the one thing you have to do is use @aar in order to include the ProGuard lines

compile 'com.parse:parse-android:1.14.1@aar'

@Jawnnypoo
Copy link
Member

@rogerhu Interesting, might be worth adding that as the instruction in the README instead then

@rogerhu
Copy link
Contributor

rogerhu commented Apr 3, 2017

Yep, we should point people to the ProGuard config if they need to manually use it.

Do people still use JARs? What if we made the packaging type AAR by default as well?

@Jawnnypoo
Copy link
Member

I am all for that, I see no reason to have it build a jar by default, as it is an Android library, not a Java library.

@rogerhu
Copy link
Contributor

rogerhu commented Apr 3, 2017

#621

@rogerhu
Copy link
Contributor

rogerhu commented Apr 3, 2017

To be clear we build both jar and aar. The change just causes the pom XML file to tell Gradle to use the war version.

Gradle in the past has difficulties with transient dependencies (I.e. okhttp depends on okio) with aar so I hope this is the only change necessary and we don't also need to use transient=true too

@hermanliang
Copy link
Contributor Author

Thanks to @rogerhu @Jawnnypoo
This issue should be resolved by #621.
I think we can close this PR.

@hermanliang hermanliang closed this Apr 5, 2017
@hermanliang hermanliang deleted the update-readme branch April 5, 2017 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants