Skip to content

Update For Gradle Kotlin DSL #22

@MamboBryan

Description

@MamboBryan

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions