Skip to content

Commit

Permalink
Tweak and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler committed Jan 1, 2025
1 parent c6247de commit b9373fb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 31 deletions.
3 changes: 0 additions & 3 deletions src/docs/configuration/merging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ This allows a [`Transformer`](https://gradleup.com/shadow/api/com/github/jengelm
determine if it should process a particular entry and apply any modifications before writing the stream to the output.

```groovy
// Adding a Transformer
import com.github.jengelman.gradle.plugins.shadow.transformers.Transformer
import com.github.jengelman.gradle.plugins.shadow.transformers.TransformerContext
import javax.annotation.Nonnull
Expand Down Expand Up @@ -38,7 +37,6 @@ tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.Shadow
Additionally, a `Transformer` can accept a `Closure` to configure the provided `Transformer`.

```groovy
// Configuring a Transformer
import com.github.jengelman.gradle.plugins.shadow.transformers.Transformer
import com.github.jengelman.gradle.plugins.shadow.transformers.TransformerContext
import javax.annotation.Nonnull
Expand Down Expand Up @@ -71,7 +69,6 @@ tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.Shadow
An instantiated instance of a `Transformer` can also be provided.

```groovy
// Adding a Transformer Instance
import com.github.jengelman.gradle.plugins.shadow.transformers.Transformer
import com.github.jengelman.gradle.plugins.shadow.transformers.TransformerContext
import javax.annotation.Nonnull
Expand Down
2 changes: 1 addition & 1 deletion src/docs/publishing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ publishing {
}
repositories {
maven {
url "https://repo.myorg.com"
url = "https://repo.myorg.com"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import java.nio.file.Path
import kotlin.io.path.createDirectory
import kotlin.io.path.writeText
import org.gradle.testkit.runner.GradleRunner
import org.intellij.lang.annotations.Language

class GroovyBuildExecutor(
override val fixture: SnippetFixture,
Expand All @@ -14,7 +13,23 @@ class GroovyBuildExecutor(
) : SnippetExecutor {

override fun execute(tempDir: Path, snippet: String) {
tempDir.resolve("settings.gradle").writeText(settingsBuildText)
tempDir.resolve("settings.gradle").writeText(
"""
dependencyResolutionManagement {
repositories {
mavenLocal()
mavenCentral()
}
}
include 'api', 'main'
""".trimIndent(),
)
val projectBuildText = """
plugins {
id 'java'
id 'com.gradleup.shadow'
}
""".trimIndent() + System.lineSeparator()
tempDir.addSubProject("api", projectBuildText)

val (imports, snippetWithoutImports) = importExtractor(snippet)
Expand All @@ -24,7 +39,6 @@ class GroovyBuildExecutor(

val allArguments = listOf(
"--warning-mode=fail",
"--configuration-cache",
"--stacktrace",
) + arguments
try {
Expand All @@ -45,24 +59,4 @@ class GroovyBuildExecutor(
.resolve("build.gradle")
.writeText(buildScriptText)
}

private companion object {
@Language("Groovy")
private val settingsBuildText = """
rootProject.name = 'shadowTest'
include 'api', 'main'
""".trimIndent()

@Language("Groovy")
private val projectBuildText = """
plugins {
id 'java'
id 'com.gradleup.shadow'
}
repositories {
mavenLocal()
mavenCentral()
}
""".trimIndent()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ object GroovyDslFixture : SnippetFixture {
id("com.gradleup.shadow")
id("application")
}
repositories {
mavenLocal()
mavenCentral()
}
version = "1.0"
group = "shadow"
""".trimIndent()
Expand Down

0 comments on commit b9373fb

Please sign in to comment.