Skip to content

Commit

Permalink
Merge pull request #2502 from mbeddr/bugfix/build
Browse files Browse the repository at this point in the history
Fix broken build
  • Loading branch information
sergej-koscejev authored Sep 10, 2024
2 parents fc82cf0 + 9d1ce7d commit 26e1abb
Showing 1 changed file with 23 additions and 26 deletions.
49 changes: 23 additions & 26 deletions subprojects/com.mbeddr/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
plugins {
id 'base'
id 'maven-publish'
}

// path variables
// If mpsHomeDir is set explicitly, skip the MPS resolution step and use the explicit path (which may be relative from
// the root directory).
Expand Down Expand Up @@ -103,30 +98,32 @@ File scriptFile(String relativePath) {
}

private static void configureRepositories(Project project) {
project.publishing {
repositories {
maven {
url project.mbeddrBuildNumber.endsWith('-SNAPSHOT') ? project.snapshotRepository : project.releaseRepository
if (project.hasProperty('artifacts.itemis.cloud.user') && project.hasProperty('artifacts.itemis.cloud.pw')) {
credentials {
username project.getProperty('artifacts.itemis.cloud.user')
password project.getProperty('artifacts.itemis.cloud.pw')
project.pluginManager.withPlugin('maven-publish') {
project.publishing {
repositories {
maven {
url project.mbeddrBuildNumber.endsWith('-SNAPSHOT') ? project.snapshotRepository : project.releaseRepository
if (project.hasProperty('artifacts.itemis.cloud.user') && project.hasProperty('artifacts.itemis.cloud.pw')) {
credentials {
username project.getProperty('artifacts.itemis.cloud.user')
password project.getProperty('artifacts.itemis.cloud.pw')
}
}
}
}

//mbeddr build is "master" also for maintenance branches
//using the closure to delay evaluate from configuration to execution phase is important because the
//mbeddrBuild property is created by a "subproject" block which is executed after this script is configured.
//if no closure is used the build script won't compile.
if({project.mbeddrBuild}() == "master") {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/mbeddr/mbeddr.core"
if (project.hasProperty("gpr.token")) {
credentials {
username = project.findProperty("gpr.user")
password = project.findProperty("gpr.token")
//mbeddr build is "master" also for maintenance branches
//using the closure to delay evaluate from configuration to execution phase is important because the
//mbeddrBuild property is created by a "subproject" block which is executed after this script is configured.
//if no closure is used the build script won't compile.
if({project.mbeddrBuild}() == "master") {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/mbeddr/mbeddr.core"
if (project.hasProperty("gpr.token")) {
credentials {
username = project.findProperty("gpr.user")
password = project.findProperty("gpr.token")
}
}
}
}
Expand Down

0 comments on commit 26e1abb

Please sign in to comment.