Skip to content

Commit d358a75

Browse files
authored
Move rewrite-go Go module up one directory (#7329)
Move go.mod and Go source files from rewrite-go/rewrite/ to rewrite-go/ so the module path github.com/openrewrite/rewrite/rewrite-go matches the directory structure. This allows the Go module proxy to discover the module from repo tags without requiring a replace directive.
1 parent ccb7d23 commit d358a75

File tree

100 files changed

+11
-9
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+11
-9
lines changed

rewrite-go/build.gradle.kts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@ tasks.withType<Javadoc>().configureEach {
3131
}
3232

3333
val goBuild = tasks.register<Exec>("goBuild") {
34-
workingDir = file("rewrite")
34+
workingDir = projectDir
3535
// Use relative path to avoid absolute paths in cache key (Exec args are cache inputs)
36-
commandLine("go", "build", "-o", layout.buildDirectory.file("rewrite-go-rpc").get().asFile.relativeTo(file("rewrite")).path, "./cmd/rpc")
36+
commandLine("go", "build", "-o", layout.buildDirectory.file("rewrite-go-rpc").get().asFile.relativeTo(projectDir).path, "./cmd/rpc")
3737

38-
inputs.files(fileTree("rewrite") {
38+
inputs.files(fileTree(projectDir) {
3939
include("**/*.go")
4040
include("go.mod")
4141
include("go.sum")
42+
exclude("build/**")
4243
}).withPathSensitivity(PathSensitivity.RELATIVE)
4344
outputs.file(layout.buildDirectory.file("rewrite-go-rpc"))
4445
}
@@ -86,7 +87,7 @@ val generateTestClasspath by tasks.registering {
8687
group = "golang"
8788
description = "Generate classpath file for Java RPC server (used by Go tests)"
8889

89-
val outputFile = file("rewrite/test-classpath.txt")
90+
val outputFile = file("test-classpath.txt")
9091
outputs.file(outputFile)
9192

9293
dependsOn(tasks.named("compileJava"))
@@ -103,26 +104,27 @@ val generateTestClasspath by tasks.registering {
103104
}
104105
}
105106

106-
val junitXmlFile = file("rewrite/build/test-results/gotest/junit.xml")
107+
val junitXmlFile = file("build/test-results/gotest/junit.xml")
107108

108109
val goTest = tasks.register<Exec>("goTest") {
109110
group = "verification"
110111
description = "Run Go tests"
111112

112-
workingDir = file("rewrite")
113+
workingDir = projectDir
113114
commandLine("go", "run", "gotest.tools/gotestsum@latest",
114-
"--junitfile", junitXmlFile.relativeTo(file("rewrite")).path,
115+
"--junitfile", junitXmlFile.relativeTo(projectDir).path,
115116
"--format", "standard-verbose",
116117
"--", "-count=1", "./test/...")
117118

118119
dependsOn(generateTestClasspath)
119120

120-
inputs.files(fileTree("rewrite") {
121+
inputs.files(fileTree(projectDir) {
121122
include("**/*.go")
122123
include("go.mod")
123124
include("go.sum")
125+
exclude("build/**")
124126
}).withPathSensitivity(PathSensitivity.RELATIVE)
125-
inputs.file(file("rewrite/test-classpath.txt"))
127+
inputs.file(file("test-classpath.txt"))
126128
outputs.file(junitXmlFile)
127129
outputs.cacheIf { true }
128130
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)