how to post a multiplatform library to github pack...
# multiplatform
w
how to post a multiplatform library to github packages ?
k
Did you ever resolve this?
w
Well , yeah I have posted the library https://gitHub.com/timeline-notes/compose-draggable-list But there was something wrong Everytime I tried to use the library in another multiplatform project I could use it in Android module and the desktop module but the classes won't appear in the common module It might have been a build issue So I created an issue on the compose-jb repository on GitHub and someone said use compose as compile only and I did that even though that didn't solve the issue
Put your GitHub properties in github.properties file And use this code in your common module with the
maven-publish
plugin and sync and Gradle tasks for publishing to GitHub packages will be generated Also change the repository GitHub properties include gpt.usr and gpt.key , username and GitHub token key respectively
Copy code
val githubProperties = Properties()
try {
    githubProperties.load(FileInputStream(rootProject.file("github.properties")))
} catch (e: Exception) {
}

afterEvaluate {
    publishing {
        repositories {
            maven {
                name = "GithubPackages"
                /** Configure path of your package repository on Github
                 *  Replace GITHUB_USERID with your/organisation Github userID and REPOSITORY with the repository name on GitHub
                 */
                url = uri("<https://maven.pkg.github.com/timeline-notes/compose-draggable-list|https://maven.pkg.github.com/timeline-notes/compose-draggable-list>")

                credentials {
                    /**Create github.properties in root project folder file with gpr.usr=GITHUB_USER_ID  & gpr.key=PERSONAL_ACCESS_TOKEN**/
                    username = (githubProperties["gpr.usr"] ?: System.getenv("GPR_USER")).toString()
                    password = (githubProperties["gpr.key"] ?: System.getenv("GPR_API_KEY")).toString()
                }
            }
        }
    }
}
If you don't get the issue where your multiplatform library code is not available in the common module of another multiplatform library , do let me know !