1
-
2
1
plugins {
3
2
kotlin(" multiplatform" ) apply false
4
3
kotlin(" plugin.serialization" ) apply false
@@ -20,7 +19,7 @@ fun computeVersion(): Any {
20
19
return if (versionFile.exists()) {
21
20
versionFile.readText().trim()
22
21
} else {
23
- gitVersion().let { if (it.endsWith(" -SNAPSHOT" )) it else " $it -SNAPSHOT" }.also { versionFile.writeText(it) }
22
+ gitVersion().let { if (it.endsWith(" -SNAPSHOT" )) it else " $it -SNAPSHOT" }.also { versionFile.writeText(it) }
24
23
}
25
24
}
26
25
@@ -51,10 +50,35 @@ subprojects {
51
50
}
52
51
}
53
52
}
53
+ val ghp_username = project.findProperty(" gpr.user" ) as ? String ? : System .getenv(" GITHUB_ACTOR" )
54
+ val ghp_password = project.findProperty(" gpr.key" ) as ? String ? : System .getenv(" GITHUB_TOKEN" )
55
+ if (ghp_username != null && ghp_password != null ) {
56
+ maven {
57
+ name = " GitHubPackages"
58
+ // we moved some components from modelix/modelix to modelix/modelix.core but github packages
59
+ // cannot handle this situation. basically we suffer from what is described here:
60
+ // https://github.com/orgs/community/discussions/23474
61
+ // this is a simple workaround for the affected components.
62
+ // consequently, when obtaining these dependencies, the repo url is the old modelix/modelix one...
63
+ if (project.name in arrayOf(" model-client" ,
64
+ " model-client-js" ,
65
+ " model-client-jvm" ,
66
+ " model-server" ,
67
+ " model-server-api" )) {
68
+ url = uri(" https://maven.pkg.github.com/modelix/modelix" )
69
+ } else {
70
+ url = uri(" https://maven.pkg.github.com/modelix/modelix.core" )
71
+ }
72
+ credentials {
73
+ username = ghp_username
74
+ password = ghp_password
75
+ }
76
+ }
77
+ }
54
78
}
55
79
}
56
80
}
57
81
58
82
tasks.withType< org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask > {
59
83
dependsOn(" :ts-model-api:npm_run_build" )
60
- }
84
+ }
0 commit comments