diff --git a/common/server/framework/src/main/java/org/curioswitch/common/server/framework/logging/StackdriverJsonLayout.java b/common/server/framework/src/main/java/org/curioswitch/common/server/framework/logging/StackdriverJsonLayout.java index 1089bee19..d7900d23c 100644 --- a/common/server/framework/src/main/java/org/curioswitch/common/server/framework/logging/StackdriverJsonLayout.java +++ b/common/server/framework/src/main/java/org/curioswitch/common/server/framework/logging/StackdriverJsonLayout.java @@ -272,7 +272,9 @@ public Map getContentFormat() { return result; } - /** @return The content type. */ + /** + * @return The content type. + */ @Override public String getContentType() { return CONTENT_TYPE + "; charset=" + this.getCharset(); diff --git a/scrapers/instagram/server/src/main/java/org/curioswitch/scrapers/instagram/server/models/GraphImage.java b/scrapers/instagram/server/src/main/java/org/curioswitch/scrapers/instagram/server/models/GraphImage.java index d703b0c85..0007e37d1 100644 --- a/scrapers/instagram/server/src/main/java/org/curioswitch/scrapers/instagram/server/models/GraphImage.java +++ b/scrapers/instagram/server/src/main/java/org/curioswitch/scrapers/instagram/server/models/GraphImage.java @@ -41,6 +41,5 @@ public interface GraphImage { /** The location the caption was taken. */ @JsonProperty("location") - @Nullable - Location getLocation(); + @Nullable Location getLocation(); } diff --git a/settings.gradle.kts b/settings.gradle.kts index aabd4cf0d..e5ae26d61 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -47,7 +47,7 @@ pluginManagement { plugins { id("com.gradle.enterprise").version("3.6.3") - id("org.curioswitch.gradle-curiostack-plugin").version("0.9.0") + id("org.curioswitch.gradle-curiostack-plugin").version("0.9.1") } configure { diff --git a/tools/golang-test/main.go b/tools/golang-test/main.go index dd6d68bc6..7a021ce21 100644 --- a/tools/golang-test/main.go +++ b/tools/golang-test/main.go @@ -1,26 +1,24 @@ -/* - * MIT License - * - * Copyright (c) 2018 Choko (choko@curioswitch.org) - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ +// MIT License +// +// Copyright (c) 2018 Choko (choko@curioswitch.org) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package main diff --git a/tools/gradle-plugins/gradle-curiostack-plugin/gradle.properties b/tools/gradle-plugins/gradle-curiostack-plugin/gradle.properties index 7ac073b1b..0f8762b9f 100644 --- a/tools/gradle-plugins/gradle-curiostack-plugin/gradle.properties +++ b/tools/gradle-plugins/gradle-curiostack-plugin/gradle.properties @@ -21,4 +21,4 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # -version=0.9.0 +version=0.9.1 diff --git a/tools/gradle-plugins/gradle-curiostack-plugin/src/main/java/org/curioswitch/gradle/plugins/curiostack/CuriostackRootPlugin.java b/tools/gradle-plugins/gradle-curiostack-plugin/src/main/java/org/curioswitch/gradle/plugins/curiostack/CuriostackRootPlugin.java index 7e7e29bd0..964c59abc 100644 --- a/tools/gradle-plugins/gradle-curiostack-plugin/src/main/java/org/curioswitch/gradle/plugins/curiostack/CuriostackRootPlugin.java +++ b/tools/gradle-plugins/gradle-curiostack-plugin/src/main/java/org/curioswitch/gradle/plugins/curiostack/CuriostackRootPlugin.java @@ -30,6 +30,7 @@ import static net.ltgt.gradle.errorprone.CheckSeverity.WARN; import com.diffplug.gradle.spotless.SpotlessExtension; +import com.diffplug.gradle.spotless.SpotlessExtensionPredeclare; import com.diffplug.gradle.spotless.SpotlessPlugin; import com.github.benmanes.gradle.versions.VersionsPlugin; import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask; @@ -269,6 +270,9 @@ public void apply(Project rootProject) { plugins.apply(TerraformSetupPlugin.class); plugins.apply(ToolDownloaderPlugin.class); + rootProject.getRepositories().mavenCentral(); + rootProject.getRepositories().mavenLocal(); + var updateGradleWrapper = rootProject.getTasks().register("curioUpdateWrapper", UpdateGradleWrapperTask.class); @@ -757,6 +761,21 @@ private static void setupSpotless(Project rootProject) { .map(line -> line.isEmpty() ? "#" : "# " + line) .collect(Collectors.joining("\n", "", "\n\n")); + rootProject.getPlugins().apply(SpotlessPlugin.class); + rootProject + .getExtensions() + .configure(SpotlessExtension.class, SpotlessExtension::predeclareDeps); + rootProject + .getExtensions() + .configure( + SpotlessExtensionPredeclare.class, + spotless -> { + spotless.java( + java -> + java.googleJavaFormat( + ToolDependencies.getGoogleJavaFormatVersion(rootProject))); + }); + rootProject.subprojects( project -> { // Don't apply spotless to intermediate projects, CurioStack currently doesn't have a use diff --git a/tools/gradle-plugins/gradle-curiostack-plugin/src/main/java/org/curioswitch/gradle/plugins/curiostack/ToolDependencies.java b/tools/gradle-plugins/gradle-curiostack-plugin/src/main/java/org/curioswitch/gradle/plugins/curiostack/ToolDependencies.java index bade82231..6ff62499b 100644 --- a/tools/gradle-plugins/gradle-curiostack-plugin/src/main/java/org/curioswitch/gradle/plugins/curiostack/ToolDependencies.java +++ b/tools/gradle-plugins/gradle-curiostack-plugin/src/main/java/org/curioswitch/gradle/plugins/curiostack/ToolDependencies.java @@ -38,7 +38,7 @@ public class ToolDependencies { .put("claat", "2.2.0") .put("gcloud", "351.0.0") .put("golang", "1.16.7") - .put("google-java-format", "1.11.0") + .put("google-java-format", "1.15.0") .put("gradle", "7.4.1") .put("miniconda", "Miniconda3-py39_4.10.3") .put("node", "14.17.4") diff --git a/tools/gradle-plugins/gradle-golang-plugin/src/test/resources/test-projects/cgo-disabled/main.go b/tools/gradle-plugins/gradle-golang-plugin/src/test/resources/test-projects/cgo-disabled/main.go index 1af9ce5ce..6308c7f5a 100644 --- a/tools/gradle-plugins/gradle-golang-plugin/src/test/resources/test-projects/cgo-disabled/main.go +++ b/tools/gradle-plugins/gradle-golang-plugin/src/test/resources/test-projects/cgo-disabled/main.go @@ -1,26 +1,24 @@ -/* - * MIT License - * - * Copyright (c) 2019 Choko (choko@curioswitch.org) - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ +// MIT License +// +// Copyright (c) 2019 Choko (choko@curioswitch.org) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package main