kyonifer / koma

A scientific computing library for Kotlin. https://kyonifer.github.io/koma
Other
270 stars 23 forks source link

Fix for Issue #107 - Bintray shutdown #108

Closed brianbolze closed 3 years ago

brianbolze commented 3 years ago

Hey folks. My team at Core has a potential fix for the Bintray shutdown #107 . It's working for us and would love to give back to the team who worked hard on putting koma together in the first place.

@kyonifer Let us know if this works!

kyonifer commented 3 years ago

Thanks for putting this together. Looks like a good solution to me-- host on a github maven repo. We might also want to update the documentation to show people the correct dependencies block to bring in koma from the GH maven repo. Do you happen to have a dependencies declaration you could share?

brianbolze commented 3 years ago

Thanks for the feedback, and I like the idea of adding a snippet for what the dependencies declaration should look like.

Before we do, it would be nice to keep the namespace all in com.kyonifer. If you can add https://github.com/Satchitananda as a maintainer, he can generate and push the packages to your repo, and then we can go and make those changes and update the PR.

Sound good?

CC @Satchitananda

kyonifer commented 3 years ago

I agree that having them in a centralized place would be better. No need for you guys to trouble yourselves with that-- I already pushed them to kyonifer/koma, and I can merge this branch (+ namespace changes) if this route works out.

Looking into how to actually give users access to these maven artifacts: It looks like there's currently no way to do unauthenticated github maven access (1, 2), and Github employees seem to officially support checking in a PAT to user repositories, intentionally obfuscating the encoding to work around GH's detection mechanism that disables PATs that have been checked in somewhere public. This gentleman has written a guide on PATs, but in my limited testing, directly commiting the PAT into source the way he did will get the PAT deactivated (obfuscation is needed).

Alternatively, this repo has a gradle plugin that attempts to do that sort of thing automatically, by using a global public PAT. I was able to get a test project configured with the following build.gradle to download koma:

buildscript {
  ext.kotlin_version = '1.3.10'
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
    mavenCentral()
  }
  dependencies {
    classpath "io.github.0ffz:gpr-for-gradle:1.2.1"
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  }
}
apply plugin: "io.github.0ffz.github-packages"
apply plugin: 'kotlin'
apply plugin: 'application'

mainClassName = 'demo.HelloWorldKt'

defaultTasks 'run'

repositories {
  mavenCentral()
  repositories {
    maven githubPackage.invoke("kyonifer")
  }
}

dependencies {
  compile group: "com.kyonifer", name:"koma-core-ejml", version: "0.12.1"
  compile group: "com.kyonifer", name:"koma-plotting", version: "0.12.1"

  compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
  testCompile 'junit:junit:4.11'
  testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
}

Anyone know of a better solution? All of these options seem pretty hacky.

drmoose commented 3 years ago

This solution doesn't appear to include -common artifacts. At least none of the packages I can find seem to provide API symbols for the "common" project in a multiplatform build. Is that deliberate or am I missing something?

drmoose commented 3 years ago

I was indeed missing something. The common symbols are in the -metadata artifacts now. There seem to be a bunch of lingering issues with transitive dependencies but I can open a separate PR for that once I get it figured out more.

:+1:

kyonifer commented 3 years ago

Going to go ahead and merge this, since it looks like a solution thats working for now.