Skip to content

Commit

Permalink
updating modelix
Browse files Browse the repository at this point in the history
  • Loading branch information
ftomassetti committed Apr 20, 2022
1 parent d1f5f6b commit ce18d71
Showing 1 changed file with 37 additions and 10 deletions.
47 changes: 37 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,26 @@ import de.itemis.mps.gradle.RunAntScript

buildscript {
repositories {
maven { url 'https://projects.itemis.de/nexus/content/repositories/mbeddr' }
mavenCentral()
mavenLocal()
jcenter()
mavenLocal()
mavenCentral()
maven { url 'https://projects.itemis.de/nexus/content/repositories/mbeddr' }
maven { url 'https://plugins.gradle.org/m2/' }
maven {
name = "Modelix GitHubPackages"
url = uri("https://maven.pkg.github.com/modelix/modelix")
if (project.findProperty("mpsserver.github.user") != null && project.findProperty("mpsserver.github.token") != null) {
credentials {
username = project.findProperty("mpsserver.github.user").toString()
password = project.findProperty("mpsserver.github.token").toString()
}
} else {
throw new RuntimeException("no credentials set")
}
}
}

dependencies {
classpath 'de.itemis.mps:mps-gradle-plugin:1.0.85.03fbeda'
classpath 'de.itemis.mps:mps-gradle-plugin:1.3.206.7322ef0'
}
}

Expand All @@ -31,6 +43,17 @@ description = "MpsServer"
project.archivesBaseName = "mpsserver"
version = ext.mpsServerVersion

def getGithubCredentials() {
if (project.hasProperty("mpsserver.github.user") && project.hasProperty("mpsserver.github.token")) {
return new Tuple(project.findProperty("mpsserver.github.user").toString(), project.findProperty("mpsserver.github.token").toString())
} else {
logger.error("Please specify your github username (gpr.user) and access token (gpr.key) in ~/.gradle/gradle.properties")
return null
}
}

ext.githubCredentials = getGithubCredentials()

configurations {
mps
mpsArtifacts
Expand Down Expand Up @@ -58,13 +81,17 @@ repositories {
url 'https://projects.itemis.de/nexus/content/groups/OS/'
}
maven {
name = "GitHubPackages"
name = "Modelix GitHubPackages"
url = uri("https://maven.pkg.github.com/modelix/modelix")
credentials {
username = project.findProperty("github.user")
password = project.findProperty("github.token")
if (project.findProperty("mpsserver.github.user") != null && project.findProperty("mpsserver.github.token") != null) {
credentials {
username = project.findProperty("mpsserver.github.user").toString()
password = project.findProperty("mpsserver.github.token").toString()
}
} else {
throw new RuntimeException("no credentials set")
}
}
}
}

if (!hasProperty("jdk_home")) {
Expand Down

0 comments on commit ce18d71

Please sign in to comment.