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

Update For Gradle Kotlin DSL #22

Open
MamboBryan opened this issue Jan 7, 2022 · 7 comments
Open

Update For Gradle Kotlin DSL #22

MamboBryan opened this issue Jan 7, 2022 · 7 comments

Comments

@MamboBryan
Copy link

MamboBryan commented Jan 7, 2022

Update for all those using kotlin dsl.

Step 3 : Update build.gradle.kts inside the project module

  • add the following line in repositories under projects
 maven { setUrl("https://maven.pkg.github.com/Cuberto/liquid-swipe-android") }
  • you should have something that looks close to this
allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
        maven { setUrl("https://maven.pkg.github.com/Cuberto/liquid-swipe-android") }
    }
}

Step 4 : Update build.gradle.kts inside the app module that is using the library

  • add the following imports at the top of the file
import org.jetbrains.kotlin.konan.properties.Properties
import java.io.FileInputStream
  • read the needed vaues from the github.properties file
val props = Properties().apply {
    load(FileInputStream(File(rootProject.rootDir, "github.properties")))
}
val githubUserId: String? = props.getProperty("gpr.user")
val githubApiKey:String? = props.getProperty("gpr.key")

repositories {
    maven(url = uri("https://maven.pkg.github.com/Cuberto/liquid-swipe-android")) {
        name = "GitHubPackages"
        credentials {
            username = githubUserId ?: System.getenv("GPR_USER")
            password = githubApiKey ?: System.getenv("GPR_API_KEY")
        }
    }
}
  • inside dependencies use the following code to consume the library
    dependencies {
        implementation "com.cuberto:liquid-swipe:1.0.0"
        ....
    }
  • Sync project and now you can use liquid-swipe library
@elyornasrullayev
Copy link

how to add these to android studion chipmunk

@MamboBryan
Copy link
Author

@elyornasrullayev what do you mean by adding it android studio chipmunk?

@elyornasrullayev
Copy link

@elyornasrullayev what do you mean by adding it android studio chipmunk?

I can't your dependencies to my project, my android studio is chipmunk.

@MamboBryan
Copy link
Author

@elyornasrullayev what do you mean by adding it android studio chipmunk?

I can't your dependencies to my project, my android studio is chipmunk.

What is the specific gradle version you're using for the project you'd like to add this library?

@elyornasrullayev
Copy link

last version

@MamboBryan
Copy link
Author

Can you be a little bit more specific, this is because how the project files are structured in gradle 1.4.0 is very different from 1.7.0

@mohit-0204
Copy link

@MamboBryan hey bro i am getting error on the import line

import org.jetbrains.kotlin.konan.properties.Properties

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

3 participants