Skip to content

Commit

Permalink
Fix testing after upgrade to Gradle 7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
prokod committed May 6, 2024
1 parent a964559 commit 7db0adc
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,23 +151,36 @@ enum ScalaPluginCompileTargetCaseType {
' in favor of Scala Plugin own determined flags'
})
}
// jvm greater then 8
else {
// Scala 2.12.17+ and jvm greater then 8 - force 8 and issue message on that
// Scala 2.12.17+ (when this is the case compilerTargetArgs size is 2) and '-Xfatal-warnings'
if (compilerTargetArgs.size() > 1 && containsFailOnWarnings(scalaCompileOptions)) {
return new Tuple2(compilerTargetArgs, null)
return new Tuple2(compilerTargetArgs, { gradleVersion ->
"Detected Gradle version: ${gradleVersion} and Scala compiler version is 2.12.17+." +
" User scalac flags: ${scalaCompileOptions.additionalParameters.join(', ')}" +
" includes '-Xfatal-warnings'." +
" CrossbuildScala Plugin recommended scalac flags: ${compilerTargetArgs.join(', ')}" +
', will be forced to prevent Scala compile from failing'
})
}
// scala 2.13 and higher
// Scala 2.13 and higher
else if (compilerTargetArgs.find { it.startsWith('-release:') }) {
return new Tuple2([], { gradleVersion ->
"Detected Gradle version: ${gradleVersion} and Scala compiler version is 2.13.1 and above." +
" CrossbuildScala Plugin recommended scalac flags: ${compilerTargetArgs.join(', ')}" +
' , will be skipped in favor of Scala Plugin own determined flags'
', will be skipped in favor of Scala Plugin own determined flags'
})
}
// Scala prior to 2.12.17
// The plugin logic for default compiler flags are better suited, in this scenario, than Gradle's own
// defaults
else {
return new Tuple2(compilerTargetArgs, { gradleVersion ->
"Detected Gradle version: ${gradleVersion} and Scala compiler version is 2.12.116 and below." +
" CrossbuildScala Plugin recommended scalac flags: ${compilerTargetArgs.join(', ')}" +
', will be forced to prevent Scala compile from failing'
})
}
//
// else {
//
// }
}
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ class ScalaCompileTasks {
// println(">>> [cc-2] " + t.scalaCompileOptions.additionalParameters.join(', '))
// }
def compileCase = ScalaPluginCompileTargetCaseType.from(extension.project.gradle.gradleVersion)
// println(">>> compileCase:" + compileCase)
// println(">>> compileCase:" + ScalaCompilerTargetType.from(scalaVersionInsights.compilerVersion))

def (options, msgFunction) = compileCase.getCompilerOptionsFunction()
.call(ScalaCompilerTargetType.from(scalaVersionInsights.compilerVersion),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,8 @@ dependencies {
result.task(":app:build").outcome == SUCCESS
where:
gradleVersion | defaultScalaVersion
'5.6.4' | '2.11'
'6.9.4' | '2.12'
'7.6.2' | '2.11'
'8.3' | '2.12'
'7.6.4' | '2.11'
'8.7' | '2.12'
}

/**
Expand Down Expand Up @@ -401,14 +399,10 @@ dependencies {

where:
gradleVersion | defaultScalaVersion | scalazQmarked
'5.6.4' | '2.12' | false
'6.9.4' | '2.12' | false
'7.6.2' | '2.11' | false
'8.3' | '2.11' | false
'5.6.4' | '2.12' | true
'6.9.4' | '2.12' | true
'7.6.2' | '2.11' | true
'8.3' | '2.11' | true
'7.6.4' | '2.11' | false
'8.7' | '2.12' | false
'7.6.4' | '2.11' | true
'8.7' | '2.12' | true
}

@Requires({ instance.testMavenCentralAccess() })
Expand Down Expand Up @@ -647,9 +641,7 @@ dependencies {

where:
gradleVersion | defaultScalaVersion
'5.6.4' | '2.12'
'6.9.4' | '2.12'
'7.6.2' | '2.11'
'8.3' | '2.11'
'7.6.4' | '2.11'
'8.7' | '2.12'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ crossBuildResolvedDsl - Summary report for cross building resolved Dsl
result.output.contains('_3]')
where:
gradleVersion << ['6.9.4', '7.6.2', '8.3']
gradleVersion << ['7.6.4', '8.7']
}
@Unroll
Expand Down Expand Up @@ -119,7 +119,7 @@ crossBuild {
result.task(":tasks").outcome == SUCCESS
where:
gradleVersion << ['5.6.4', '6.9.4', '7.6.2', '8.3']
gradleVersion << ['7.6.4', '8.7']
}
@Unroll
Expand Down Expand Up @@ -175,7 +175,7 @@ publishing {
result.task(":tasks").outcome == SUCCESS
where:
gradleVersion << ['5.6.4', '6.9.4', '7.6.2', '8.3']
gradleVersion << ['7.6.4', '8.7']
}
@Unroll
Expand Down Expand Up @@ -211,10 +211,8 @@ crossBuild {
where:
gradleVersion | pluginId
'5.6.4' | 'com.github.prokod.gradle-crossbuild'
'6.9.4' | 'com.github.prokod.gradle-crossbuild-scala'
'7.6.2' | 'com.github.prokod.gradle-crossbuild-scala'
'8.3' | 'com.github.prokod.gradle-crossbuild-scala'
'7.6.4' | 'com.github.prokod.gradle-crossbuild'
'8.7' | 'com.github.prokod.gradle-crossbuild-scala'
}
@Unroll
Expand Down Expand Up @@ -255,7 +253,7 @@ crossBuild {
result.task(":crossBuildV211Jar").outcome == SUCCESS
where:
gradleVersion << ['5.6.4', '6.9.4', '7.6.2', '8.3']
gradleVersion << ['7.6.4', '8.7']
}
@Unroll
Expand Down Expand Up @@ -304,7 +302,7 @@ gradle.projectsEvaluated {
result.task(":crossBuildV211Jar").outcome == SUCCESS
where:
gradleVersion << ['5.6.4', '6.9.4', '7.6.2', '8.3']
gradleVersion << ['7.6.4', '8.7']
}
@Unroll
Expand Down Expand Up @@ -392,7 +390,7 @@ gradle.projectsEvaluated {
result.task(":crossBuildSpark24_212Jar").outcome == SUCCESS
where:
gradleVersion << ['5.6.4', '6.9.4', '7.6.2', '8.3']
gradleVersion << ['7.6.4', '8.7']
}
@Unroll
Expand Down Expand Up @@ -462,7 +460,7 @@ crossBuildV213Jar - Assembles a jar archive containing the crossBuildV213 classe
result.task(":tasks").outcome == SUCCESS
where:
gradleVersion << ['5.6.4', '6.9.4', '7.6.2', '8.3']
gradleVersion << ['7.6.4', '8.7']
}
@Unroll
Expand Down Expand Up @@ -523,7 +521,7 @@ publishing {
result.task(":publishCrossBuildV211PublicationToMavenLocal").outcome == SUCCESS
where:
gradleVersion << ['5.6.4', '6.9.4', '7.6.2', '8.3']
gradleVersion << ['7.6.4', '8.7']
}
@Unroll
Expand Down Expand Up @@ -571,7 +569,7 @@ sourceSets {
result.task(":crossBuild211Jar").outcome == SUCCESS
where:
gradleVersion << ['5.6.4', '6.9.4', '7.6.2', '8.3']
gradleVersion << ['7.6.4', '8.7']
}
@Unroll
Expand Down Expand Up @@ -604,7 +602,7 @@ crossBuild {
thrown(RuntimeException)
where:
gradleVersion << ['5.6.4', '6.9.4', '7.6.2', '8.3']
gradleVersion << ['7.6.4', '8.7']
}
@Unroll
Expand Down Expand Up @@ -639,7 +637,7 @@ crossBuild {
thrown(RuntimeException)
where:
gradleVersion << ['5.6.4', '6.9.4', '7.6.2', '8.3']
gradleVersion << ['7.6.4', '8.7']
}
@Unroll
Expand Down Expand Up @@ -674,6 +672,6 @@ crossBuild {
result.task(":crossBuildV213Jar").outcome == SUCCESS
where:
gradleVersion << ['5.6.4', '6.9.4', '7.6.2', '8.3']
gradleVersion << ['7.6.4', '8.7']
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@ class ScalaVersionInsightsTest extends Specification {

where:
version | artifactInlinedVersion | baseVersion | compilerVersion | strippedArtifactInlinedVersion | scalaCompilerDefaultTargetJvm
'2.9' | '2.9.3' | '2.9' | '2.9.3' | '293' | 'jvm-1.5'
'2.10' | '2.10' | '2.10' | '2.10.6' | '210' | 'jvm-1.6'
'2.10.6' | '2.10' | '2.10' | '2.10.6' | '210' | 'jvm-1.6'
'2.11' | '2.11' | '2.11' | '2.11.12' | '211' | 'jvm-1.8'
'2.11.12'| '2.11' | '2.11' | '2.11.12' | '211' | 'jvm-1.8'
'2.11.11'| '2.11' | '2.11' | '2.11.11' | '211' | 'jvm-1.6'
'2.12' | '2.12' | '2.12' | '2.12.12' | '212' | 'jvm-1.8'
'2.12.12'| '2.12' | '2.12' | '2.12.12' | '212' | 'jvm-1.8'
'2.12.16'| '2.12' | '2.12' | '2.12.16' | '212' | 'jvm-1.8'
'2.12.17'| '2.12' | '2.12' | '2.12.17' | '212' | '8'
'2.13' | '2.13' | '2.13' | '2.13.3' | '213' | 'jvm-1.8'
'2.13.3' | '2.13' | '2.13' | '2.13.3' | '213' | 'jvm-1.8'
'2.13.0' | '2.13' | '2.13' | '2.13.0' | '213' | 'jvm-1.8'
'3' | '3' | '3' | '3.2.2' | '3' | '11'
'3.2.2' | '3' | '3' | '3.2.2' | '3' | '11'
'2.9' | '2.9.3' | '2.9' | '2.9.3' | '293' | new Tuple2('jvm-1.5', null)
'2.10' | '2.10' | '2.10' | '2.10.6' | '210' | new Tuple2('jvm-1.6', null)
'2.10.6' | '2.10' | '2.10' | '2.10.6' | '210' | new Tuple2('jvm-1.6', null)
'2.11' | '2.11' | '2.11' | '2.11.12' | '211' | new Tuple2('jvm-1.8', null)
'2.11.12'| '2.11' | '2.11' | '2.11.12' | '211' | new Tuple2('jvm-1.8', null)
'2.11.11'| '2.11' | '2.11' | '2.11.11' | '211' | new Tuple2('jvm-1.6', null)
'2.12' | '2.12' | '2.12' | '2.12.12' | '212' | new Tuple2('jvm-1.8', null)
'2.12.12'| '2.12' | '2.12' | '2.12.12' | '212' | new Tuple2('jvm-1.8', null)
'2.12.16'| '2.12' | '2.12' | '2.12.16' | '212' | new Tuple2('jvm-1.8', null)
'2.12.17'| '2.12' | '2.12' | '2.12.17' | '212' | new Tuple2('8', '8')
'2.13' | '2.13' | '2.13' | '2.13.3' | '213' | new Tuple2('jvm-1.8', null)
'2.13.3' | '2.13' | '2.13' | '2.13.3' | '213' | new Tuple2('jvm-1.8', null)
'2.13.0' | '2.13' | '2.13' | '2.13.0' | '213' | new Tuple2('jvm-1.8', null)
'3' | '3' | '3' | '3.2.2' | '3' | new Tuple2(null, '11')
'3.2.2' | '3' | '3' | '3.2.2' | '3' | new Tuple2(null, '11')
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ crossBuild {
JSONAssert.assertEquals(expectedJsonAsText, actualJsonAsText, false)

where:
gradleVersion << ['5.6.4', '6.9.4', '7.6.2', '8.2']
gradleVersion << ['7.6.4', '8.7']
}
}

0 comments on commit 7db0adc

Please sign in to comment.