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

Gradle configuration problem in 2.0.7 #222

Open
bejibx opened this issue Jun 3, 2019 · 5 comments
Open

Gradle configuration problem in 2.0.7 #222

bejibx opened this issue Jun 3, 2019 · 5 comments

Comments

@bejibx
Copy link
Contributor

bejibx commented Jun 3, 2019

Hi! I think I suddenly break gradle configuration with my recent PR with incap support.

For version 2.0.7 to work properly I have to add both paperparcel and paperparcel-api artifacts even despite the fact that paperparcel-api declared using api configuration inside paperparcel module.

@bejibx
Copy link
Contributor Author

bejibx commented Jun 3, 2019

Here is Android documentation about dependency configurations. So if add PaperParcel dependency like this:

implementation "nz.bradcampbell:paperparcel:2.0.7"
kapt "nz.bradcampbell:paperparcel-compiler:2.0.7"

I cant build my project because classes from paperparcel-api module are not visible in my project.

So to fix this I have to also declare dependency to paperparcel-api:

implementation "nz.bradcampbell:paperparcel:2.0.7"
implementation "nz.bradcampbell:paperparcel-api:2.0.7"
kapt "nz.bradcampbell:paperparcel-compiler:2.0.7"

@grandstaish
Copy link
Owner

Hmm, I wonder why. It looks like it is declared as an API dependency https://github.com/grandstaish/paperparcel/blob/master/paperparcel/build.gradle#L30

@bejibx
Copy link
Contributor Author

bejibx commented Jun 4, 2019

So I create sample project to check this is not some weird issue with my main project and still got same behavior. build.gradle file is pretty standard:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "ru.bejibx.koin"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.core:core-ktx:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'nz.bradcampbell:paperparcel:2.0.8'
    implementation 'nz.bradcampbell:paperparcel-kotlin:2.0.8' // Optional
    kapt 'nz.bradcampbell:paperparcel-compiler:2.0.8'
}

Again, I have to add implementation 'nz.bradcampbell:paperparcel-api:2.0.8' to be able to use @PaperParcel annotation and other classes from paperparcel-api module. Maybe we should update readme while we are trying to find out whats going on?

@bejibx
Copy link
Contributor Author

bejibx commented Jun 4, 2019

Could this be related to how this library is packaged? Maybe we should update some gradle plugin to properly support new dependency configurations?

@bejibx
Copy link
Contributor Author

bejibx commented Jun 4, 2019

Maybe this will be helpful? Or probably we should update android-maven-gradle-plugin?

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

No branches or pull requests

2 participants