-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration test with RepositoriesMode.FAIL_ON_PROJECT_REPOS #134
- Loading branch information
Showing
6 changed files
with
97 additions
and
0 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
49 changes: 49 additions & 0 deletions
49
src/test/resources/fixtures/node-depresolutionmgmt/build.gradle
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,49 @@ | ||
import org.gradle.util.GradleVersion | ||
|
||
plugins { | ||
id "com.github.node-gradle.node" | ||
} | ||
|
||
node { | ||
version = "12.13.0" | ||
distBaseUrl = null | ||
download = true | ||
workDir = file("build/node") | ||
} | ||
|
||
def changeScript = isPropertyEnabled("changeScript") | ||
def changeArgs = isPropertyEnabled("changeArgs") | ||
|
||
task hello(type: NodeTask) { | ||
script = file("simple.js") | ||
args = [] | ||
outputs.upToDateWhen { | ||
true | ||
} | ||
} | ||
|
||
if (changeScript) { | ||
hello.script = file("name.js") | ||
} | ||
|
||
if (changeArgs) { | ||
hello.args = ["Bob", "Alice"] | ||
} | ||
|
||
task executeDirectoryScript(type: NodeTask) { | ||
script = file(".") | ||
outputs.upToDateWhen { | ||
true | ||
} | ||
} | ||
|
||
task version(type: NodeTask) { | ||
script = file("version.js") | ||
} | ||
|
||
def isPropertyEnabled(String name) { | ||
if (GradleVersion.current() >= GradleVersion.version("6.6")) { | ||
return providers.systemProperty(name).forUseAtConfigurationTime().isPresent() | ||
} | ||
return System.properties[name] != null | ||
} |
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,5 @@ | ||
const args = process.argv.slice(2); | ||
|
||
for (const name of args) { | ||
console.log(`Hello ${name}`); | ||
} |
25 changes: 25 additions & 0 deletions
25
src/test/resources/fixtures/node-depresolutionmgmt/settings.gradle
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,25 @@ | ||
import org.gradle.api.initialization.resolve.RepositoriesMode | ||
import org.gradle.util.GradleVersion | ||
|
||
if (GradleVersion.current() >= GradleVersion.version("6.8")) { | ||
dependencyResolutionManagement { | ||
repositories { | ||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) | ||
|
||
ivy { | ||
name = "Node.js" | ||
setUrl("https://nodejs.org/dist/") | ||
patternLayout { | ||
artifact("v[revision]/[artifact](-v[revision]-[classifier]).[ext]") | ||
ivy("v[revision]/ivy.xml") | ||
} | ||
metadataSources { | ||
artifact() | ||
} | ||
content { | ||
includeModule("org.nodejs", "node") | ||
} | ||
} | ||
} | ||
} | ||
} |
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 @@ | ||
console.log("Hello World"); |
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 @@ | ||
console.log(`Version: ${process.version}`); |