Skip to content

Commit

Permalink
safety.build: various fixes in the build scripts on the mps side
Browse files Browse the repository at this point in the history
build.gradle.kts: re-written publications
  • Loading branch information
ratiud committed Dec 22, 2024
1 parent 1751b22 commit b021cb7
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 28 deletions.
47 changes: 42 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ plugins {

val jbrVers = "17.0.8.1-b1000.32"
val jbrWindowsVers = "jbr_jcef-17.0.8.1-windows-x64-b1000.32"
val jbrLinuxVers = "jbr_jcef-17.0.8.1-linux-x64-b1000.32"

downloadJbr {
jbrVersion = jbrVers
Expand Down Expand Up @@ -162,6 +163,16 @@ val defaultScriptArgs = mapOf(

fun scriptFile(relativePath: String):File = File("$rootDir/build/scripts/patched/$relativePath")

fun unpackAndRenameJBR(archiveName : String, nameOfDirectoryInsideArchive : String, nameOfJbrDirectory : String) {
val jbrDownloadDir = jdkDir.toString() + "/../jbrDownload";
//project.delete(files("${jbrDownloadDir}"));
copy {
from(tarTree(resources.gzip(jdkDir.toString() + "/${archiveName}")))
into(jbrDownloadDir)
}
file(jbrDownloadDir + "/${nameOfDirectoryInsideArchive}").renameTo(file("${jbrDownloadDir}/${nameOfJbrDirectory}"))
}

tasks {
val configureJava by registering {
dependsOn(downloadJbr)
Expand Down Expand Up @@ -355,14 +366,40 @@ tasks {
val resolvedArtifact = configurations["jbrWin"].resolvedConfiguration.resolvedArtifacts.find { ra -> ra.file.name == filename }!!
resolvedArtifact.name + "-" + resolvedArtifact.classifier + "." + resolvedArtifact.extension
}

doLast {
unpackAndRenameJBR("jbr_jcef-windows-x64.tgz", jbrWindowsVers, "jbr_windows");
}
}

val resolveJBR_Linux by registering(Copy::class) {
from(configurations["jbrLinux"])
into(jdkDir)
rename { filename ->
val resolvedArtifact = configurations["jbrLinux"].resolvedConfiguration.resolvedArtifacts.find { ra -> ra.file.name == filename }!!
resolvedArtifact.name + "-" + resolvedArtifact.classifier + "." + resolvedArtifact.extension
}

doLast {
unpackAndRenameJBR("jbr_jcef-linux-x64.tgz", jbrLinuxVers, "jbr_linux");
}
}

val package_fasten_distribution_for_specific_platforms by registering(BuildLanguages::class) {
dependsOn(build_fasten_safety_distribution)
dependsOn(resolveJBR_Win, resolveJBR_Linux, build_fasten_safety_distribution)
script = scriptFile("build-fasten-distribution-for-specific-platforms.xml")
}

val produce_fasten_distribution_win by registering {
dependsOn(package_fasten_distribution_for_specific_platforms)
artifactsDir.file("com.mbeddr.formal.safetyDistribution.platforms/fasten-${version}-Win.zip")
}

val produce_fasten_distribution_linux by registering {
dependsOn(package_fasten_distribution_for_specific_platforms)
artifactsDir.file("com.mbeddr.formal.safetyDistribution.platforms/fasten-${version}-Linux.tar.gz")
}

val build_all_languages by registering {
dependsOn(build_assurance_languages, build_formal_languages)
}
Expand Down Expand Up @@ -500,16 +537,16 @@ publishing {
}
}
}
/* create<MavenPublication>("FASTEN_WIN_RCP") {
create<MavenPublication>("FASTEN_WIN_RCP") {
groupId = "fasten"
artifactId = "win.rcp"
artifact(tasks.named("package_fasten_safety_distribution_win"))
artifact(tasks.named("produce_fasten_distribution_win"))
}
create<MavenPublication>("FASTEN_LINUX_RCP") {
groupId = "fasten"
artifactId = "linux.rcp"
artifact(tasks.named("package_fasten_safety_distribution_linux"))
}*/
artifact(tasks.named("produce_fasten_distribution_linux"))
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17013,27 +17013,6 @@
</node>
</node>
</node>
<node concept="398223" id="5MWJzF9DC6L" role="39821P">
<node concept="3_J27D" id="5MWJzF9DC6N" role="Nbhlr">
<node concept="3Mxwew" id="5MWJzF9DC9E" role="3MwsjC">
<property role="3MwjfP" value="jbr" />
</node>
</node>
<node concept="2HvfSZ" id="5MWJzF9DC9u" role="39821P">
<node concept="398BVA" id="5MWJzF9DC9y" role="2HvfZ0">
<ref role="398BVh" node="wUJmWCxY0g" resolve="mbeddr.formal.home" />
<node concept="2Ry0Ak" id="4PPhkJT65fy" role="iGT6I">
<property role="2Ry0Am" value="build" />
<node concept="2Ry0Ak" id="4PPhkJT65f_" role="2Ry0An">
<property role="2Ry0Am" value="jbrDownload" />
<node concept="2Ry0Ak" id="7KdgwcVLlqS" role="2Ry0An">
<property role="2Ry0Am" value="jbr" />
</node>
</node>
</node>
</node>
</node>
</node>
<node concept="398223" id="42jqVeFkUvx" role="39821P">
<node concept="3_J27D" id="42jqVeFkUvy" role="Nbhlr">
<node concept="3Mxwew" id="42jqVeFkUvz" role="3MwsjC">
Expand Down Expand Up @@ -19807,6 +19786,27 @@
</node>
</node>
</node>
<node concept="398223" id="2Gyww3MdWZ" role="39821P">
<node concept="3_J27D" id="2Gyww3MdX0" role="Nbhlr">
<node concept="3Mxwew" id="2Gyww3MdX1" role="3MwsjC">
<property role="3MwjfP" value="jbr" />
</node>
</node>
<node concept="2HvfSZ" id="2Gyww3MdX2" role="39821P">
<node concept="398BVA" id="2Gyww3MdX3" role="2HvfZ0">
<ref role="398BVh" node="nwXZr_8le_" resolve="mbeddr.formal.home" />
<node concept="2Ry0Ak" id="2Gyww3MdX4" role="iGT6I">
<property role="2Ry0Am" value="build" />
<node concept="2Ry0Ak" id="2Gyww3MdX5" role="2Ry0An">
<property role="2Ry0Am" value="jbrDownload" />
<node concept="2Ry0Ak" id="2Gyww3MdX6" role="2Ry0An">
<property role="2Ry0Am" value="jbr_linux" />
</node>
</node>
</node>
</node>
</node>
</node>
<node concept="3_J27D" id="nwXZr$UPy_" role="Nbhlr">
<node concept="3Mxwew" id="nwXZr$UPyA" role="3MwsjC">
<property role="3MwjfP" value="fasten" />
Expand All @@ -19815,7 +19815,7 @@
<property role="3MwjfP" value="-" />
</node>
<node concept="3Mxwey" id="nwXZr$UPyC" role="3MwsjC">
<ref role="3Mxwex" node="nwXZr_mN4z" resolve="build.number" />
<ref role="3Mxwex" node="nwXZr$UPwH" resolve="version" />
</node>
<node concept="3Mxwew" id="nwXZr$UPyD" role="3MwsjC">
<property role="3MwjfP" value="-Linux.tar.gz" />
Expand Down Expand Up @@ -20149,6 +20149,27 @@
</node>
</node>
</node>
<node concept="398223" id="5MWJzF9DC6L" role="39821P">
<node concept="3_J27D" id="5MWJzF9DC6N" role="Nbhlr">
<node concept="3Mxwew" id="5MWJzF9DC9E" role="3MwsjC">
<property role="3MwjfP" value="jbr" />
</node>
</node>
<node concept="2HvfSZ" id="5MWJzF9DC9u" role="39821P">
<node concept="398BVA" id="5MWJzF9DC9y" role="2HvfZ0">
<ref role="398BVh" node="nwXZr_8le_" resolve="mbeddr.formal.home" />
<node concept="2Ry0Ak" id="4PPhkJT65fy" role="iGT6I">
<property role="2Ry0Am" value="build" />
<node concept="2Ry0Ak" id="4PPhkJT65f_" role="2Ry0An">
<property role="2Ry0Am" value="jbrDownload" />
<node concept="2Ry0Ak" id="7KdgwcVLlqS" role="2Ry0An">
<property role="2Ry0Am" value="jbr_windows" />
</node>
</node>
</node>
</node>
</node>
</node>
<node concept="3_J27D" id="nwXZr$UP$U" role="Nbhlr">
<node concept="3Mxwew" id="nwXZr$UP$V" role="3MwsjC">
<property role="3MwjfP" value="fasten" />
Expand All @@ -20157,7 +20178,7 @@
<property role="3MwjfP" value="-" />
</node>
<node concept="3Mxwey" id="nwXZr$UP$X" role="3MwsjC">
<ref role="3Mxwex" node="nwXZr_mN4z" resolve="build.number" />
<ref role="3Mxwex" node="nwXZr$UPwH" resolve="version" />
</node>
<node concept="3Mxwew" id="nwXZr$UP$Y" role="3MwsjC">
<property role="3MwjfP" value="-Win.zip" />
Expand Down

0 comments on commit b021cb7

Please sign in to comment.