File tree Expand file tree Collapse file tree
src/main/kotlin/xyz/srnyx/gradlegalaxy/utility Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,6 +35,12 @@ import kotlin.apply
3535import kotlin.text.replace
3636
3737
38+ private val json by lazy { Json {
39+ prettyPrint = true
40+ prettyPrintIndent = " "
41+ ignoreUnknownKeys = true
42+ } }
43+
3844/* *
3945 * @return Whether the project is running in a GitHub Actions workflow
4046 */
@@ -59,7 +65,7 @@ val inGitHubPreRelease: Boolean by lazy {
5965/* *
6066 * @return Whether the project is running in a GitHub Actions release workflow
6167 */
62- val inGitHubRelease: Boolean = ! inGitHubPreRelease
68+ val inGitHubRelease: Boolean by lazy { ! inGitHubPreRelease }
6369
6470/* *
6571 * Makes the given package path safe to use
@@ -279,12 +285,6 @@ fun Project.relocate(
279285 tasks.named<ShadowJar >(" shadowJar" ) { relocate(from, to, action) }
280286}
281287
282- private val json = Json {
283- prettyPrint = true
284- prettyPrintIndent = " "
285- ignoreUnknownKeys = true
286- }
287-
288288fun Project.addPlatformsResourceFileTask (platforms : Map <PluginPlatform , String >): TaskProvider <Task > {
289289 val platformsFile = project.layout.buildDirectory.file(" resources/main/platforms.json" ).get().asFile
290290 val platformsProvider = project.provider { json.encodeToString(mapOf (" platforms" to platforms)) }
You can’t perform that action at this time.
0 commit comments