File tree Expand file tree Collapse file tree 4 files changed +34
-32
lines changed
Expand file tree Collapse file tree 4 files changed +34
-32
lines changed Original file line number Diff line number Diff line change 1+ import org.gradle.api.Project
2+ import org.gradle.api.artifacts.dsl.RepositoryHandler
3+ import org.gradle.api.artifacts.repositories.MavenArtifactRepository
4+
5+ /* *
6+ * Set up GitHub Packages Registry for a specific repository.
7+ *
8+ * To use this GPR locally, you need to set the `gpr.user` and `gpr.key` properties
9+ * in your `~/.gradle/gradle.properties` file, for example:
10+ * ```
11+ * gpr.user=your-github-username
12+ * gpr.key=your-github-token
13+ * ```
14+ * Note: token must have "packages: read" permissions.
15+ *
16+ * On CI, provide `GITHUB_ACTOR` and `GITHUB_TOKEN` environment variables.
17+ */
18+ fun RepositoryHandler.githubPackages (
19+ project : Project ,
20+ repo : String ,
21+ setup : MavenArtifactRepository .() -> Unit = {},
22+ ) = with (project) {
23+ maven {
24+ name = " GitHubPackages"
25+ url = uri(" https://maven.pkg.github.com/$repo " )
26+ credentials {
27+ username = findProperty(" gpr.user" ) as String? ? : System .getenv(" USERNAME" )
28+ password = findProperty(" gpr.key" ) as String? ? : System .getenv(" TOKEN" )
29+ }
30+ setup()
31+ }
32+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -11,11 +11,10 @@ group = "org.usvm"
1111
1212repositories {
1313 mavenCentral()
14+ githubPackages(project, " UnitTestBot/jacodb" )
1415 maven(" https://jitpack.io" )
1516}
1617
17- setupJacodbGitHubPackagesRepository()
18-
1918dependencies {
2019 // Align versions of all Kotlin components
2120 implementation(platform(kotlin(" bom" , Versions .kotlin)))
Original file line number Diff line number Diff line change @@ -28,11 +28,10 @@ tasks {
2828
2929repositories {
3030 mavenCentral()
31+ githubPackages(project, " UnitTestBot/jacodb" )
3132 maven(" https://jitpack.io" )
3233}
3334
34- setupJacodbGitHubPackagesRepository()
35-
3635dependencies {
3736 compileOnly(Libs .jacodb_api_jvm)
3837}
You can’t perform that action at this time.
0 commit comments