Skip to content

Commit 4514973

Browse files
committed
Changed listOfNotNull to listOf, because was still learning Kotlin when I wrote the initial ones.
1 parent 4026880 commit 4514973

File tree

10 files changed

+26
-34
lines changed

10 files changed

+26
-34
lines changed

build-logic/aggregator/src/main/kotlin/org.xtclang.build.aggregator.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ plugins {
1111
private class XdkBuildAggregator(project: Project) : Runnable {
1212
companion object {
1313
private val lifeCycleTasks =
14-
listOfNotNull(ASSEMBLE_TASK_NAME, BUILD_TASK_NAME, CHECK_TASK_NAME, CLEAN_TASK_NAME)
14+
listOf(ASSEMBLE_TASK_NAME, BUILD_TASK_NAME, CHECK_TASK_NAME, CLEAN_TASK_NAME)
1515
}
1616

1717
private val prefix = "[${project.name}]"

build-logic/common-plugins/src/main/kotlin/GitHubPackages.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ class GitHubPackages(project: Project) : XdkProjectBuildLogic(project) {
3232
private const val GITHUB_USER_RO_DEFAULT_VALUE = "xtclang-bot"
3333
private const val GITHUB_TOKEN_RO_DEFAULT_VALUE = "Z2hwX0ZjNGRWeDhNYmxPcnZDYWZrRW96Q0NrQXAzaVZ5RjBUb0NheAo="
3434

35-
val publishTaskPrefixes = listOfNotNull("list", "delete")
36-
val publishTaskSuffixesRemote = listOfNotNull("AllRemotePublications")
37-
val publishTaskSuffixesLocal = listOfNotNull("AllLocalPublications")
35+
val publishTaskPrefixes = listOf("list", "delete")
36+
val publishTaskSuffixesRemote = listOf("AllRemotePublications")
37+
val publishTaskSuffixesLocal = listOf("AllLocalPublications")
3838

39-
fun restHeaders(token: String): List<Pair<String, String>> = listOfNotNull(
39+
fun restHeaders(token: String): List<Pair<String, String>> = listOf(
4040
"Accept" to "application/vnd.github+json",
4141
"X-GitHub-Api-Version" to "2022-11-28",
4242
"Authorization" to "Bearer $token")

build-logic/common-plugins/src/main/kotlin/XdkDistribution.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class XdkDistribution(project: Project): XdkProjectBuildLogic(project) {
1616
private val currentOs = OperatingSystem.current()
1717
private val isCiEnabled = System.getenv(CI) == "true"
1818

19-
val distributionTasks = listOfNotNull("distTar", "distZip")
19+
val distributionTasks = listOf("distTar", "distZip", "distExe")
2020
}
2121

2222
init {

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ plugins {
1313

1414
private val xdk = gradle.includedBuild("xdk")
1515
private val plugin = gradle.includedBuild("plugin")
16-
private val includedBuildsWithPublications = listOfNotNull(xdk, plugin)
16+
private val includedBuildsWithPublications = listOf(xdk, plugin)
1717

1818
/**
1919
* Installation and distribution tasks that aggregate publishable/distributable included

javatools/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ val sanityCheckJar by tasks.registering {
124124

125125
DebugBuild.verifyJarFileContents(
126126
project,
127-
listOfNotNull(
127+
listOf(
128128
"implicit.x", // verify the implicits are in the jar
129129
"org/xvm/tool/Compiler", // verify the javatools package is in there, including Compiler and Runner
130130
"org/xvm/tool/Runner",

lib_ecstasy/build.gradle.kts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ plugins {
1515
alias(libs.plugins.xtc)
1616
}
1717

18-
val xdkTurtle by configurations.registering {
18+
val xdkTurtleConsumer by configurations.registering {
1919
isCanBeResolved = true
2020
isCanBeConsumed = false
2121
attributes {
@@ -24,11 +24,19 @@ val xdkTurtle by configurations.registering {
2424
}
2525
}
2626

27+
val xdkUnicodeConsumer by configurations.registering {
28+
isCanBeResolved = true
29+
isCanBeConsumed = false
30+
attributes {
31+
attribute(CATEGORY_ATTRIBUTE, objects.named(LIBRARY))
32+
attribute(LIBRARY_ELEMENTS_ATTRIBUTE, objects.named("unicodeDir"))
33+
}
34+
}
35+
2736
dependencies {
28-
// TODO: Find out why xdkJavaTools is not an unstable API, while xdkTurtle and xdkUnicode are.
2937
xdkJavaTools(libs.javatools)
3038
@Suppress("UnstableApiUsage")
31-
xdkTurtle(libs.javatools.turtle) // A dependency declaration like this works equally well if we are working with an included build/project or with an artifact. This is exactly what we want.
39+
xdkTurtleConsumer(libs.javatools.turtle) // A dependency declaration like this works equally well if we are working with an included build/project or with an artifact. This is exactly what we want.
3240
}
3341

3442
val compileXtc by tasks.existing(XtcCompileTask::class) {
@@ -45,15 +53,7 @@ sourceSets {
4553
main {
4654
xtc {
4755
// mack.x is in a different project, and does not build on its own, hence we add it to the lib_ecstasy source set instead.
48-
srcDir(xdkTurtle)
56+
srcDir(xdkTurtleConsumer)
4957
}
50-
//resources {
51-
// Skip the local unicode files if we are in "rebuild unicode" mode.
52-
//if (xdkBuild.rebuildUnicode()) {
53-
// exclude("**/ecstasy/text**")
54-
//}
55-
//}
5658
}
5759
}
58-
59-
// TODO Add resource processing for unicode

plugin/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ gradlePlugin {
7878
displayName = getXdkProperty("$pprefix.plugin.display.name")
7979
description = getXdkProperty("$pprefix.plugin.description")
8080
logger.info("$prefix Configuring gradlePlugin; pluginId=$pluginId, implementationClass=$implementationClass, displayName=$displayName, description=$description")
81-
tags = listOfNotNull("xtc", "language", "ecstasy", "xdk")
81+
tags = listOf("xtc", "language", "ecstasy", "xdk")
8282
}
8383
}
8484
}

plugin/src/main/java/org/xtclang/plugin/tasks/XtcCompileTask.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,20 @@ public final String getJavaLauncherClassName() {
114114

115115
/**
116116
* Add an output Filename mapping.
117-
* TODO Why does IntelliJ think these are unused? Check that it doesn't lead to any unknown dependency problems for the Plugin.
118117
*/
118+
@SuppressWarnings("unused") // No, IntelliJ. It's not.
119119
public void outputFilename(final String from, final String to) {
120120
outputFilenames.add(from);
121121
outputFilenames.add(to);
122122
}
123123

124+
@SuppressWarnings("unused") // No, IntelliJ. It's not.
124125
public void outputFilename(final Pair<String, String> pair) {
125126
outputFilenames.add(pair.getFirst());
126127
outputFilenames.add(pair.getSecond());
127128
}
128129

130+
@SuppressWarnings("unused") // No, IntelliJ. It's not.
129131
public void outputFilename(final Provider<String> from, final Provider<String> to) {
130132
outputFilenames.add(from);
131133
outputFilenames.add(to);

xdk/build.gradle.kts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,6 @@ val xdkProvider by configurations.registering {
4343
}
4444
}
4545

46-
val xtcUnicodeConsumer by configurations.registering {
47-
isCanBeResolved = true
48-
isCanBeConsumed = false
49-
// TODO: Can likely remove these.
50-
attributes {
51-
attribute(CATEGORY_ATTRIBUTE, objects.named(LIBRARY))
52-
attribute(LIBRARY_ELEMENTS_ATTRIBUTE, objects.named("unicodeDir"))
53-
}
54-
}
55-
5646
dependencies {
5747
xdkJavaTools(libs.javatools)
5848
xtcModule(libs.xdk.ecstasy)
@@ -316,7 +306,7 @@ val installLocalDist by tasks.registering {
316306
listOf("xcc", "xec", "xtc").forEach {
317307
val symLink = File(binDir, it)
318308
logger.info("$prefix Copying launcher '$it' -> '${launcherExe.asFile}' (on Windows, this may require developer mode settings).")
319-
Files.copy(symLink.toPath(), launcherExe.asFile.toPath())
309+
Files.copy(launcherExe.asFile.toPath(), symLink.toPath())
320310
}
321311
}
322312
}

xdk/settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ val xdkProjectPath = rootDir
1717
/**
1818
* The explicit XDK subprojects that are built for each library included in the XDK.
1919
*/
20-
listOfNotNull(
20+
listOf(
2121
"lib_ecstasy",
2222
"lib_collections",
2323
"lib_aggregate",

0 commit comments

Comments
 (0)