diff --git a/build/com.mbeddr/distribution/build.gradle b/build/com.mbeddr/distribution/build.gradle index d7a91c692ef..f41208df472 100644 --- a/build/com.mbeddr/distribution/build.gradle +++ b/build/com.mbeddr/distribution/build.gradle @@ -31,8 +31,6 @@ task build_all_in_one(type: BuildLanguages, dependsOn: [':com.mbeddr:platform:co task build_platform_distribution(type: BuildLanguages, dependsOn: [':com.mbeddr:platform:copy_allScripts', resolve_mbeddr]) { script scriptFile('com.mbeddr.platform/build-distribution.xml') - // Support incremental build - inputs.file(script) } task package_tutorial(type: Zip) { diff --git a/build/com.mbeddr/platform/build.gradle b/build/com.mbeddr/platform/build.gradle index 83215ae29ef..17f8dead8e7 100755 --- a/build/com.mbeddr/platform/build.gradle +++ b/build/com.mbeddr/platform/build.gradle @@ -95,12 +95,6 @@ task test_mbeddr_platform(type: TestLanguages, dependsOn: build_platform) { task build_platform_distribution(type: BuildLanguages, dependsOn: [build_platform, test_mbeddr_platform]) { script scriptFile('com.mbeddr.platform/build-distribution.xml') - - // Support incremental build - inputs.file(script) - inputs.dir("$rootDir/artifacts/mps-sl-all") - inputs.dir("$rootDir/artifacts/com.mbeddr.platform") - outputs.dir("$rootDir/artifacts/com.mbeddr.platform.distribution") } task package_mbeddrPlatform(type: Zip, dependsOn: test_mbeddr_platform) { diff --git a/build/publishing/build.gradle b/build/publishing/build.gradle index df15cf58bf5..d79d8aa9387 100644 --- a/build/publishing/build.gradle +++ b/build/publishing/build.gradle @@ -1,8 +1,11 @@ +import java.nio.file.Files +import java.nio.file.Paths +import java.nio.file.StandardCopyOption import java.time.* import de.itemis.mps.gradle.GitBasedVersioning plugins { - id "co.riiid.gradle" version "0.4.2" + id "com.github.breadmoirai.github-release" version "2.5.2" } def artifactsRoot = rootProject.projectDir.absolutePath + "/artifacts" @@ -20,80 +23,49 @@ LocalDateTime t = LocalDateTime.now(); def releaseNotes = """Automated Nighly build from ${t as String}.""" -def windowsFileName = "mbeddr-win-" + t.getYear() + "-" + - t.getMonthValue() +"-"+ t.getDayOfMonth() +".exe" - -def macosFileName = "mbeddr-macos-" + t.getYear() + "-" + - t.getMonthValue() +"-"+ t.getDayOfMonth() +".dmg" - - -def allInOneFileName = "com.mbeddr.allInOne-${ext.mbeddrBuildNumber}-MPS-${mpsBuild}.zip" def tutorialFileName = "com.mbeddr.tutorial-${ext.mbeddrBuildNumber}-MPS-${mpsBuild}.zip" def platformFileName = "platform-distribution-${ext.mbeddrPlatformBuildNumber}-MPS-${mpsBuild}.zip" -github { +githubRelease { owner = 'mbeddr' repo = 'mbeddr.core' token = rootProject.hasProperty("github.token") ? rootProject.getProperty("github.token") : "empty" tagName = 'nightly-' + buildNumber targetCommitish = GitBasedVersioning.getGitCommitHash() - name = 'Nighly Build ' + buildNumber + releaseName = 'Nighly Build ' + buildNumber body = releaseNotes prerelease = true - assets = [ - artifactsRoot + "/com.mbeddr.allInOne/" + allInOneFileName, + releaseAssets = [ artifactsRoot + "/com.mbeddr.tutorial/" + tutorialFileName, artifactsRoot + "/com.mbeddr.platform.distribution/" + platformFileName, - artifactsRoot + "/rcp/" + windowsFileName, - artifactsRoot + "/rcp/" + macosFileName ] + dryRun = project.hasProperty("githubReleaseDryRun") } -task renameWindowsFile(type: Copy) { - from(artifactsRoot+ "/rcp") - into(artifactsRoot + "/rcp") - include('Setup.exe') - rename ('Setup.exe', windowsFileName) -} - -task renameMacosFile(type: Copy) { - from(artifactsRoot+ "/rcp") - into(artifactsRoot + "/rcp") - include('mbeddr-macos.dmg') - rename ('mbeddr-macos.dmg', macosFileName) -} - -task renameAllInOne(type: Copy, dependsOn: ':com.mbeddr:distribution:build_all_in_one') { - from(artifactsRoot + "/com.mbeddr.allInOne/") - into(artifactsRoot + "/com.mbeddr.allInOne/") - include("com.mbeddr.allInOne.zip") - rename("com.mbeddr.allInOne.zip", allInOneFileName) -} - -task renameTutorial(type: Copy, dependsOn: ':com.mbeddr:distribution:package_tutorial') { - from(artifactsRoot + "/com.mbeddr.tutorial/") - into(artifactsRoot + "/com.mbeddr.tutorial/") - include("com.mbeddr.tutorial.zip") - rename("com.mbeddr.tutorial.zip", tutorialFileName) +tasks.register('renameTutorial') { + dependsOn(':com.mbeddr:distribution:package_tutorial') + doLast { + def dir = Paths.get(artifactsRoot, 'com.mbeddr.tutorial') + Files.copy( + dir.resolve('com.mbeddr.tutorial.zip'), + dir.resolve(tutorialFileName), + StandardCopyOption.REPLACE_EXISTING + ) + } } -task renamePlarform(type: Copy, dependsOn: ':com.mbeddr:distribution:build_platform_distribution') { - from(artifactsRoot + "/com.mbeddr.platform.distribution/") - into(artifactsRoot + "/com.mbeddr.platform.distribution/") - include("platform-distribution.zip") - rename("platform-distribution.zip", platformFileName) +tasks.register('renamePlatform') { + dependsOn(':com.mbeddr:platform:build_platform_distribution') + doLast { + def dir = Paths.get(artifactsRoot, 'com.mbeddr.platform.distribution') + Files.copy( + dir.resolve('platform-distribution.zip'), + dir.resolve(platformFileName), + StandardCopyOption.REPLACE_EXISTING + ) + } } -task copyRenameAndDeleteWindowsSetupFile(type: Delete, dependsOn: [renameWindowsFile]) { - delete artifactsRoot + "/rcp/Setup.exe" +tasks.named('githubRelease') { + dependsOn renamePlatform, renameTutorial } - -task copyRenameAndDeleteMacosSetupFile(type: Delete, dependsOn: [renameMacosFile]) { - delete artifactsRoot + "/rcp/mbeddr-macos.dmg" -} - -githubRelease.dependsOn copyRenameAndDeleteWindowsSetupFile, - //copyRenameAndDeleteMacosSetupFile, - renameAllInOne, - renamePlarform, - renameTutorial \ No newline at end of file