Skip to content

Commit

Permalink
Merge pull request #64 from LionWeb-io/niko/move-versions-to-properties
Browse files Browse the repository at this point in the history
move versions to properties
  • Loading branch information
enikao authored Nov 1, 2023
2 parents 5c7bf7c + 6692e80 commit ecbee1e
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 37 deletions.
57 changes: 21 additions & 36 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
import org.apache.tools.ant.taskdefs.condition.Os

plugins {
id("com.specificlanguages.mps") version "1.5.0"
id("com.specificlanguages.mps")
`maven-publish`
id("signing")
id("net.researchgate.release") version "3.0.2"
id("net.researchgate.release")
}

val libs by configurations.creating

val lionwebJavaDir = File(rootDir, "solutions/io.lionweb.lionweb.java/libs")
val versionSuffix: String by project
val lionwebJavaVersion: String by project
val mpsVersion: String by project
val mpsExtensionsVersion: String by project

repositories {
maven(url = "https://artifacts.itemis.cloud/repository/maven-mps")
Expand All @@ -20,15 +21,8 @@ repositories {
}

dependencies {
"mps"("com.jetbrains:mps:2021.1.4")
"libs"("io.lionweb.lionweb-java:lionweb-java-core:0.1.2")
"generation" ("de.itemis.mps:extensions:2021.1.2365.a4d7bb2")
}

configurations.getByName("libs") {
attributes {
attribute(Attribute.of("org.gradle.dependency.bundling", String::class.java), "external")
}
"mps"("com.jetbrains:mps:$mpsVersion")
"generation" ("de.itemis.mps:extensions:$mpsExtensionsVersion")
}

group = "io.lionweb"
Expand All @@ -50,10 +44,7 @@ publishing {
maven {
val releaseRepo = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
val snapshotRepo = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
val isReleaseVersion = !(version as String).endsWith("-SNAPSHOT")
url = java.net.URI(if (isReleaseVersion) releaseRepo else snapshotRepo)
// println("isReleaseVersion $isReleaseVersion")
// println("publishing to $url")
credentials {
username = project.findProperty("ossrhUsername") as String?
password = project.findProperty("ossrhPassword") as String?
Expand All @@ -65,14 +56,15 @@ publishing {
register<MavenPublication>("mpsPlugin") {
from(components["mps"])
groupId = "io.lionweb.lionweb-mps"
artifactId = "lionweb-mps-$versionSuffix"
artifact(tasks.getByName("sourcesJar"))
artifact(tasks.getByName("javadocJar"))
// Put resolved versions of dependencies into POM files -- uncomment as soon as we have any dependencies
versionMapping { usage("java-runtime") { fromResolutionOf("generation") } }

pom {
name.set("lionweb-mps")
description.set("MPS APIs for the LionWeb system")
name.set("lionweb-mps-$versionSuffix")
description.set("MPS APIs for the LionWeb system for MPS $versionSuffix")
version = project.version as String
packaging = "zip"
url.set("/~https://github.com/LionWeb-io/lionweb-mps")
Expand Down Expand Up @@ -117,28 +109,21 @@ publishing {
}
}

task<Sync>("resolveLibs") {
from(libs)
into(lionwebJavaDir)

rename { filename ->
val ra = libs.resolvedConfiguration.resolvedArtifacts.find { ra: ResolvedArtifact -> ra.file.name == filename }!!
var finalName: String
if (ra.classifier != null) {
finalName = "${ra.name}-${ra.classifier}.${ra.extension}"
} else {
finalName = "${ra.name}.${ra.extension}"
}
logger.info("renaming $filename to $finalName")
finalName

stubs {
register("libs") {
destinationDir("solutions/io.lionweb.lionweb.java/libs")
dependency("io.lionweb.lionweb-java:lionweb-java-core:$lionwebJavaVersion")
}
}

tasks{
generateBuildscript {
dependsOn("resolveLibs")
configurations.getByName("libs") {
attributes {
attribute(Attribute.of("org.gradle.dependency.bundling", String::class.java), "external")
}
}

tasks{
checkMps {
buildScript.set(file("build-tests.xml"))
}
Expand Down
8 changes: 7 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
version=0.1.2-SNAPSHOT
version=0.1.2-SNAPSHOT
versionSuffix=2021.1
lionwebJavaVersion=0.1.2
mpsVersion=2021.1.4
mpsExtensionsVersion=2021.1.2365.a4d7bb2
comSpecificlanguagesMpsVersion=1.5.0
netResearchgateReleaseVersion=3.0.2
9 changes: 9 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
rootProject.name = "lionweb-mps"

pluginManagement {
val comSpecificlanguagesMpsVersion: String by settings
val netResearchgateReleaseVersion: String by settings
plugins {
id("com.specificlanguages.mps") version comSpecificlanguagesMpsVersion
id("net.researchgate.release") version netResearchgateReleaseVersion
}
}

0 comments on commit ecbee1e

Please sign in to comment.