From 7d6a7731745fe1e759c2cf5de1d32ced67478357 Mon Sep 17 00:00:00 2001 From: Sean McGrail Date: Tue, 13 Apr 2021 15:57:24 -0700 Subject: [PATCH] Remove Go Module Generation and Formatting --- codegen/smithy-go-codegen-test/build.gradle.kts | 8 -------- .../software/amazon/smithy/go/codegen/CodegenVisitor.java | 6 ------ .../software/amazon/smithy/go/codegen/ManifestWriter.java | 2 +- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/codegen/smithy-go-codegen-test/build.gradle.kts b/codegen/smithy-go-codegen-test/build.gradle.kts index 02bbb06a4..28ba7b6c1 100644 --- a/codegen/smithy-go-codegen-test/build.gradle.kts +++ b/codegen/smithy-go-codegen-test/build.gradle.kts @@ -31,11 +31,3 @@ dependencies { implementation("software.amazon.smithy:smithy-protocol-test-traits:[1.2.0,2.0.0[") implementation(project(":smithy-go-codegen")) } - -// ensure built artifacts are put into the SDK's folders -tasks.create("verifyGoCodegen") { - dependsOn ("build") - workingDir("$buildDir/smithyprojections/smithy-go-codegen-test/source/go-codegen") - commandLine ("go", "test", "-mod", "mod", "-run", "NONE", "./...") -} -tasks["build"].finalizedBy(tasks["verifyGoCodegen"]) diff --git a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/CodegenVisitor.java b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/CodegenVisitor.java index f57113b33..82713fa19 100644 --- a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/CodegenVisitor.java +++ b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/CodegenVisitor.java @@ -218,14 +218,8 @@ void execute() { List dependencies = writers.getDependencies(); writers.flushWriters(); - LOGGER.fine("Generating go.mod file"); - GoModGenerator.writeGoMod(settings, fileManifest, dependencies); - LOGGER.fine("Generating build manifest file"); ManifestWriter.writeManifest(settings, fileManifest, dependencies); - - LOGGER.fine("Running go fmt"); - CodegenUtils.runCommand("gofmt -w -s .", fileManifest.getBaseDir()); } @Override diff --git a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/ManifestWriter.java b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/ManifestWriter.java index 932b74aa0..2aa7802f9 100644 --- a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/ManifestWriter.java +++ b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/ManifestWriter.java @@ -68,7 +68,7 @@ public static void writeManifest( fileManifest.addFile(manifestFile); Node generatedJson = buildManifestFile(settings, fileManifest, dependencies); - fileManifest.writeFile(manifestFile.toString(), Node.prettyPrintJson(generatedJson)+"\n"); + fileManifest.writeFile(manifestFile.toString(), Node.prettyPrintJson(generatedJson) + "\n"); } private static Node buildManifestFile(