-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Movin `main` method to a separate module simplifies testing
- Loading branch information
Showing
48 changed files
with
88 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,22 @@ | ||
plugins { | ||
kotlin("js") | ||
kotlin("plugin.serialization") | ||
kotlin("js") apply false | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
jcenter() | ||
} | ||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile>().configureEach { | ||
kotlinOptions { | ||
moduleKind = "commonjs" | ||
} | ||
} | ||
} | ||
|
||
kotlin { | ||
js { | ||
browser { | ||
testTask { | ||
useMocha() | ||
testLogging { | ||
showStandardStreams = true | ||
} | ||
plugins.withId("org.jetbrains.kotlin.js") { | ||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile>().configureEach { | ||
kotlinOptions { | ||
moduleKind = "commonjs" | ||
} | ||
} | ||
binaries.executable() | ||
} | ||
} | ||
|
||
configure<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension> { | ||
nodeVersion = "12.18.3" | ||
} | ||
|
||
val String.v: String get() = rootProject.extra["$this.version"] as String | ||
|
||
dependencies { | ||
implementation(project(":lib")) | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:${"kotlinx-coroutines".v}") | ||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime:${"kotlinx-serialization".v}") | ||
implementation("org.jetbrains:kotlin-extensions:${"kotlin-wrappers".v}-kotlin-${"kotlin".v}") | ||
|
||
testImplementation(kotlin("test-js")) | ||
plugins.withType<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin> { | ||
configure<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension> { | ||
nodeVersion = "12.18.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
plugins { | ||
kotlin("js") | ||
} | ||
|
||
kotlin { | ||
js { | ||
browser() | ||
binaries.executable() | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(project(":layered-cache")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,7 @@ | ||
/* | ||
* Copyright 2020 Vladimir Sitnikov <[email protected]> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
package com.github.burrunan.gradle | ||
|
||
import com.github.burrunan.gradle.GradleCacheAction | ||
import com.github.burrunan.gradle.Parameters | ||
import com.github.burrunan.gradle.github.env.ActionsEnvironment | ||
import com.github.burrunan.gradle.github.event.currentTrigger | ||
import github.actions.core.info | ||
import kotlinext.js.jsObject | ||
import process | ||
|
||
internal fun getInput(name: String, required: Boolean = false): String = | ||
github.actions.core.getInput(name, jsObject { this.required = required }) | ||
|
||
suspend fun main() { | ||
if (process.env["GITHUB_ACTIONS"].isNullOrBlank()) { | ||
|
@@ -42,7 +20,9 @@ suspend fun main() { | |
concurrent = getInput("concurrent").ifBlank { "false" }.toBoolean(), | ||
) | ||
|
||
if (!params.generatedGradleJars && !params.localBuildCache) { | ||
if (!params.generatedGradleJars && !params.localBuildCache && | ||
!params.gradleDependenciesCache && !params.mavenDependenciesCache | ||
) { | ||
info("All the caches are disabled, skipping the action") | ||
return | ||
} | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
plugins { | ||
kotlin("js") | ||
kotlin("plugin.serialization") | ||
} | ||
|
||
kotlin { | ||
js { | ||
nodejs { | ||
testTask { | ||
useMocha() | ||
testLogging { | ||
showStandardStreams = true | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
val String.v: String get() = rootProject.extra["$this.version"] as String | ||
|
||
dependencies { | ||
api(project(":lib")) | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:${"kotlinx-coroutines".v}") | ||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime:${"kotlinx-serialization".v}") | ||
api("org.jetbrains:kotlin-extensions:${"kotlin-wrappers".v}-kotlin-${"kotlin".v}") | ||
|
||
testImplementation(kotlin("test-js")) | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions
22
layered-cache/src/main/kotlin/github/actions/core/ext/InputExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright 2020 Vladimir Sitnikov <[email protected]> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
package github.actions.core.ext | ||
|
||
import kotlinext.js.jsObject | ||
|
||
fun getInput(name: String, required: Boolean = false): String = | ||
github.actions.core.getInput(name, jsObject { this.required = required }) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters