Skip to content

Commit

Permalink
Merge pull request #2566 from mbeddr/merge/mps20222
Browse files Browse the repository at this point in the history
Merge maintenance/mps20222 into maintenance/mps20223
  • Loading branch information
sergej-koscejev authored Oct 24, 2024
2 parents ad2048f + ca2e796 commit c718578
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 21 deletions.
45 changes: 25 additions & 20 deletions subprojects/com.mbeddr/languages/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ configurations {
mbeddrPlatform
}

def usePrebuiltPlatform = ciBuild && !project.hasProperty('forceBuildPlatform')

dependencies {
junitAnt 'junit:junit:4.12'
junitAnt('org.apache.ant:ant-junit:1.9.7') {
Expand All @@ -30,9 +32,18 @@ dependencies {
junitAnt('org.apache.ant:ant-junit4:1.9.7') {
transitive = false
}
mbeddrPlatform "com.mbeddr:platform:$mbeddrPlatformBuildNumber"
}

def mbeddrPlatformDependency

if (usePrebuiltPlatform) {
// By default, on CI we don't build the platform but take it from Nexus, unless overridden by `-PforceBuildPlatform`.
mbeddrPlatformDependency = "com.mbeddr:platform:$mbeddrPlatformBuildNumber"
} else {
mbeddrPlatformDependency = project(':com.mbeddr:platform')
}

mbeddrPlatform mbeddrPlatformDependency
}

task resolve_mbeddr_platform() {
doLast {
Expand All @@ -57,16 +68,7 @@ ant.taskdef(name: 'junitreport', classname: 'org.apache.tools.ant.taskdefs.optio

def mbeddrPlatformDependency

def usePrebuiltPlatform = ciBuild && !project.hasProperty('forceBuildPlatform')

//on teamcity we don't build the platform we take it from the nexus. Locally we want to build it
if (usePrebuiltPlatform) {
mbeddrPlatformDependency = resolve_mbeddr_platform
} else {
mbeddrPlatformDependency = ':com.mbeddr:platform:build_platform'
}

task build_mbeddr(type: BuildLanguages, dependsOn: [':com.mbeddr:platform:copy_allScripts', mbeddrPlatformDependency]) {
task build_mbeddr(type: BuildLanguages, dependsOn: [':com.mbeddr:platform:copy_allScripts', configurations.mbeddrPlatform]) {
script script_build_mbeddr
outputs.dir("$artifactsDir/mbeddr")
}
Expand Down Expand Up @@ -162,19 +164,24 @@ task test_mbeddr_xmodel(dependsOn: []) {}

task test_mbeddr(dependsOn: [test_mbeddr_core, test_mbeddr_performance, test_mbeddr_cc, test_mbeddr_ext, test_mbeddr_xmodel]) {}

def pubDeb
if (ciBuild) {
pubDeb = test_mbeddr
} else {
pubDeb = build_mbeddr
tasks.register('test') {
dependsOn(test_mbeddr)
}

tasks.named('check') {
dependsOn 'test'
}

task package_mbeddr(type: Zip, dependsOn: pubDeb) {
task package_mbeddr(type: Zip, dependsOn: build_mbeddr) {
archiveFileName = 'com.mbeddr.zip'
from artifactsDir
include "mbeddr/**"
}

artifacts {
'default'(package_mbeddr)
}

publishing {
publications {
mbeddr(MavenPublication) {
Expand Down Expand Up @@ -225,5 +232,3 @@ if({project.mbeddrBuild}() == "master") {
*/
tasks.findByName("publishMbeddrPublicationToMavenRepository").dependsOn("publishMbeddrPublicationToGitHubPackagesRepository")
}

check.dependsOn test_mbeddr
15 changes: 14 additions & 1 deletion subprojects/com.mbeddr/platform/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,29 @@ task test_mbeddr_platform(type: TestLanguages, dependsOn: [build_platform, gener
targets 'check'
}

tasks.register('test') {
dependsOn(test_mbeddr_platform)
}

tasks.named('check') {
dependsOn('test')
}

task build_platform_distribution(type: BuildLanguages, dependsOn: [build_platform, test_mbeddr_platform]) {
script scriptFile('com.mbeddr.platform/build-distribution.xml')
}

task package_mbeddrPlatform(type: Zip, dependsOn: test_mbeddr_platform) {
task package_mbeddrPlatform(type: Zip, dependsOn: build_platform) {
archiveFileName = 'com.mbeddr.platform.zip'
from artifactsDir
include "com.mbeddr.platform/**"
}

artifacts {
'default'(package_mbeddrPlatform)
}


task defaultWrapper(dependsOn: build_platform) {
doFirst {
println "####################################################################################"
Expand Down

0 comments on commit c718578

Please sign in to comment.