From 2c0df7735e21f2715e27cdda9c733571cc206ab9 Mon Sep 17 00:00:00 2001 From: Dmytro Dashenkov Date: Fri, 21 Aug 2020 14:20:25 +0300 Subject: [PATCH 01/13] Consolidate `spine-protoc-plugin` location in one class --- config | 2 +- license-report.md | 30 ++++++------- .../JavaProtocConfigurationPlugin.java | 44 ++++++++++++------- .../gradle/ProtocConfigurationPlugin.java | 32 +------------- .../dart/DartProtocConfigurationPlugin.java | 3 -- .../gradle/JsProtocConfigurationPlugin.java | 7 +++ 6 files changed, 54 insertions(+), 64 deletions(-) diff --git a/config b/config index 264273f0e8..c5e92c00fe 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit 264273f0e80cfafc9429a9908f7e78975765d2b0 +Subproject commit c5e92c00fee4f2d255c46029d235cd78aacb94a3 diff --git a/license-report.md b/license-report.md index c6b9047897..10e8e4ea81 100644 --- a/license-report.md +++ b/license-report.md @@ -329,7 +329,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 12:33:14 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 14:18:10 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -785,7 +785,7 @@ This report was generated on **Fri Aug 21 12:33:14 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 12:33:15 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 14:18:11 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1169,7 +1169,7 @@ This report was generated on **Fri Aug 21 12:33:15 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 12:33:16 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 14:18:11 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1545,7 +1545,7 @@ This report was generated on **Fri Aug 21 12:33:16 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 12:33:16 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 14:18:12 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1937,7 +1937,7 @@ This report was generated on **Fri Aug 21 12:33:16 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 12:33:17 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 14:18:12 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -2317,7 +2317,7 @@ This report was generated on **Fri Aug 21 12:33:17 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 12:33:17 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 14:18:13 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -2693,7 +2693,7 @@ This report was generated on **Fri Aug 21 12:33:17 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 12:33:17 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 14:18:13 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -3123,7 +3123,7 @@ This report was generated on **Fri Aug 21 12:33:17 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 12:33:18 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 14:18:14 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -3499,7 +3499,7 @@ This report was generated on **Fri Aug 21 12:33:18 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 12:33:18 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 14:18:14 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -3875,7 +3875,7 @@ This report was generated on **Fri Aug 21 12:33:18 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 12:33:19 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 14:18:14 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -4201,7 +4201,7 @@ This report was generated on **Fri Aug 21 12:33:19 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 12:33:19 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 14:18:15 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -4545,7 +4545,7 @@ This report was generated on **Fri Aug 21 12:33:19 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 12:33:19 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 14:18:15 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -4925,7 +4925,7 @@ This report was generated on **Fri Aug 21 12:33:19 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 12:33:20 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 14:18:16 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -5269,7 +5269,7 @@ This report was generated on **Fri Aug 21 12:33:20 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 12:33:20 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 14:18:16 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -5613,4 +5613,4 @@ This report was generated on **Fri Aug 21 12:33:20 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 12:33:20 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Fri Aug 21 14:18:16 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/JavaProtocConfigurationPlugin.java b/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/JavaProtocConfigurationPlugin.java index d5f4ddbba3..95a0fb4041 100644 --- a/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/JavaProtocConfigurationPlugin.java +++ b/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/JavaProtocConfigurationPlugin.java @@ -20,7 +20,6 @@ package io.spine.tools.gradle.compiler; -import com.google.errorprone.annotations.OverridingMethodsMustInvokeSuper; import com.google.protobuf.gradle.ExecutableLocator; import com.google.protobuf.gradle.GenerateProtoTask; import io.spine.code.fs.java.DefaultJavaProject; @@ -56,6 +55,7 @@ import static io.spine.tools.gradle.ModelCompilerTaskName.writeTestPluginConfiguration; import static io.spine.tools.gradle.ProtocPluginName.grpc; import static io.spine.tools.gradle.ProtocPluginName.spineProtoc; +import static org.gradle.internal.os.OperatingSystem.current; /** * A Gradle plugin that performs additional {@code protoc} configurations relevant for Java @@ -68,6 +68,34 @@ public final class JavaProtocConfigurationPlugin extends ProtocConfigurationPlug private static final String GRPC_GROUP = "io.grpc"; private static final String GRPC_PLUGIN_NAME = "protoc-gen-grpc-java"; + private static final String SH_EXTENSION = "sh"; + private static final String BAT_EXTENSION = "bat"; + private static final String SCRIPT_CLASSIFIER = "script"; + private static final String SPINE_PLUGIN_NAME = "spine-protoc-plugin"; + + @Override + protected void + configureProtocPlugins(NamedDomainObjectContainer plugins) { + plugins.create(grpc.name(), + locator -> locator.setArtifact(Artifact.newBuilder() + .setGroup(GRPC_GROUP) + .setName(GRPC_PLUGIN_NAME) + .setVersion(VERSIONS.grpc()) + .build() + .notation())); + plugins.create(spineProtoc.name(), locator -> { + boolean windows = current().isWindows(); + String scriptExt = windows ? BAT_EXTENSION : SH_EXTENSION; + locator.setArtifact(Artifact.newBuilder() + .useSpineToolsGroup() + .setName(SPINE_PLUGIN_NAME) + .setVersion(VERSIONS.spineBase()) + .setClassifier(SCRIPT_CLASSIFIER) + .setExtension(scriptExt) + .build() + .notation()); + }); + } @Override protected void customizeTask(GenerateProtoTask protocTask) { @@ -149,20 +177,6 @@ static File rootSpineDirectory(Project project) { return at(project.getRootDir()).tempArtifacts(); } - @OverridingMethodsMustInvokeSuper - @Override - protected void - configureProtocPlugins(NamedDomainObjectContainer plugins) { - super.configureProtocPlugins(plugins); - plugins.create(grpc.name(), - locator -> locator.setArtifact(Artifact.newBuilder() - .setGroup(GRPC_GROUP) - .setName(GRPC_PLUGIN_NAME) - .setVersion(VERSIONS.grpc()) - .build() - .notation())); - } - @Override protected File getTestDescriptorSet(Project project) { return Extension.getTestDescriptorSet(project); diff --git a/tools/plugin-base/src/main/java/io/spine/tools/gradle/ProtocConfigurationPlugin.java b/tools/plugin-base/src/main/java/io/spine/tools/gradle/ProtocConfigurationPlugin.java index 19e851772e..16a1f7394e 100644 --- a/tools/plugin-base/src/main/java/io/spine/tools/gradle/ProtocConfigurationPlugin.java +++ b/tools/plugin-base/src/main/java/io/spine/tools/gradle/ProtocConfigurationPlugin.java @@ -21,7 +21,6 @@ package io.spine.tools.gradle; import com.google.common.collect.ImmutableList; -import com.google.errorprone.annotations.OverridingMethodsMustInvokeSuper; import com.google.protobuf.gradle.ExecutableLocator; import com.google.protobuf.gradle.GenerateProtoTask; import com.google.protobuf.gradle.ProtobufConfigurator; @@ -37,9 +36,7 @@ import static io.spine.tools.gradle.ProtobufDependencies.gradlePlugin; import static io.spine.tools.gradle.ProtobufDependencies.protobufCompiler; -import static io.spine.tools.gradle.ProtocPluginName.spineProtoc; import static io.spine.tools.groovy.ConsumerClosure.closure; -import static org.gradle.internal.os.OperatingSystem.current; /** * An abstract base for Gradle plugins that configure Protobuf compilation. @@ -49,11 +46,6 @@ */ public abstract class ProtocConfigurationPlugin extends SpinePlugin { - protected static final String SPINE_PLUGIN_NAME = "spine-protoc-plugin"; - private static final String SH_EXTENSION = "sh"; - private static final String BAT_EXTENSION = "bat"; - private static final String SCRIPT_CLASSIFIER = "script"; - protected static final DependencyVersions VERSIONS = DependencyVersions.get(); @Override @@ -107,28 +99,8 @@ private void configureProtocTasks(GenerateProtoTaskCollection tasks) { * which * is a required plugin */ - @OverridingMethodsMustInvokeSuper - protected void configureProtocPlugins(NamedDomainObjectContainer plugins) { - if (!spineProtocIsPresent(plugins)) { - plugins.create(spineProtoc.name(), locator -> { - boolean windows = current().isWindows(); - String scriptExt = windows ? BAT_EXTENSION : SH_EXTENSION; - locator.setArtifact(Artifact.newBuilder() - .useSpineToolsGroup() - .setName(SPINE_PLUGIN_NAME) - .setVersion(VERSIONS.spineBase()) - .setClassifier(SCRIPT_CLASSIFIER) - .setExtension(scriptExt) - .build() - .notation()); - }); - } - } - - private static boolean - spineProtocIsPresent(NamedDomainObjectContainer plugins) { - return plugins.findByName(spineProtoc.name()) != null; - } + protected abstract void + configureProtocPlugins(NamedDomainObjectContainer plugins); private void configureProtocTask(GenerateProtoTask protocTask) { configureDescriptorSetGeneration(protocTask); diff --git a/tools/proto-dart-plugin/src/main/java/io/spine/generate/dart/DartProtocConfigurationPlugin.java b/tools/proto-dart-plugin/src/main/java/io/spine/generate/dart/DartProtocConfigurationPlugin.java index 109459be93..2dd189cc84 100644 --- a/tools/proto-dart-plugin/src/main/java/io/spine/generate/dart/DartProtocConfigurationPlugin.java +++ b/tools/proto-dart-plugin/src/main/java/io/spine/generate/dart/DartProtocConfigurationPlugin.java @@ -20,7 +20,6 @@ package io.spine.generate.dart; -import com.google.errorprone.annotations.OverridingMethodsMustInvokeSuper; import com.google.protobuf.gradle.ExecutableLocator; import io.spine.tools.gradle.ProtocConfigurationPlugin; import org.gradle.api.NamedDomainObjectContainer; @@ -52,10 +51,8 @@ protected File getTestDescriptorSet(Project project) { return Extension.findIn(project).testDescriptorSetFile(); } - @OverridingMethodsMustInvokeSuper @Override protected void configureProtocPlugins(NamedDomainObjectContainer plugins) { - super.configureProtocPlugins(plugins); Path executable = CachedDartProtocPlugin.locate(); plugins.create(dart.name(), locator -> locator.setPath(executable.toString())); } diff --git a/tools/proto-js-plugin/src/main/java/io/spine/js/gradle/JsProtocConfigurationPlugin.java b/tools/proto-js-plugin/src/main/java/io/spine/js/gradle/JsProtocConfigurationPlugin.java index 2a5e7cf13e..c16ac319c6 100644 --- a/tools/proto-js-plugin/src/main/java/io/spine/js/gradle/JsProtocConfigurationPlugin.java +++ b/tools/proto-js-plugin/src/main/java/io/spine/js/gradle/JsProtocConfigurationPlugin.java @@ -20,8 +20,10 @@ package io.spine.js.gradle; +import com.google.protobuf.gradle.ExecutableLocator; import io.spine.code.fs.js.DefaultJsProject; import io.spine.tools.gradle.ProtocConfigurationPlugin; +import org.gradle.api.NamedDomainObjectContainer; import org.gradle.api.Project; import java.io.File; @@ -49,4 +51,9 @@ protected Path generatedFilesBaseDir(Project project) { protected File getMainDescriptorSet(Project project) { return Extension.getMainDescriptorSet(project); } + + @Override + protected void configureProtocPlugins(NamedDomainObjectContainer plugins) { + // Do nothing. + } } From 372a5763dd2da120206f68c4d21e069965e861a1 Mon Sep 17 00:00:00 2001 From: Dmytro Dashenkov Date: Fri, 21 Aug 2020 15:19:21 +0300 Subject: [PATCH 02/13] Pass plugin launcher script as a file and download Jar as a dependency --- base/src/main/java/io/spine/io/Resource.java | 17 ++++ .../JavaProtocConfigurationPlugin.java | 84 ++++++++++++++----- .../src/main/resources/plugin_runner.bat | 3 + .../src/main/resources/plugin_runner.sh | 3 + .../gradle/ProtocConfigurationPlugin.java | 9 +- .../dart/DartProtocConfigurationPlugin.java | 3 +- .../gradle/JsProtocConfigurationPlugin.java | 3 +- 7 files changed, 98 insertions(+), 24 deletions(-) create mode 100644 tools/model-compiler/src/main/resources/plugin_runner.bat create mode 100644 tools/model-compiler/src/main/resources/plugin_runner.sh diff --git a/base/src/main/java/io/spine/io/Resource.java b/base/src/main/java/io/spine/io/Resource.java index 6788568713..e72299bff5 100644 --- a/base/src/main/java/io/spine/io/Resource.java +++ b/base/src/main/java/io/spine/io/Resource.java @@ -25,8 +25,10 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterators; import com.google.common.collect.UnmodifiableIterator; +import com.google.common.io.CharStreams; import org.checkerframework.checker.nullness.qual.Nullable; +import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -203,6 +205,21 @@ public Reader openAsText() { return openAsText(UTF_8); } + /** + * Loads the whole resource file as a UTF-8 text file. + * + * @return the content of the resource file + * @throws IllegalStateException + * on a failure of opening the file, e.g. if the file does not exist + * @throws IOException + * on a failure of reading or closing the file + */ + public String read() throws IOException { + try (Reader reader = new BufferedReader(openAsText())) { + return CharStreams.toString(reader); + } + } + @Override public String toString() { return loaderCustomized() ? path + " via " + classLoader() : path; diff --git a/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/JavaProtocConfigurationPlugin.java b/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/JavaProtocConfigurationPlugin.java index 95a0fb4041..02f16e31ac 100644 --- a/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/JavaProtocConfigurationPlugin.java +++ b/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/JavaProtocConfigurationPlugin.java @@ -20,11 +20,14 @@ package io.spine.tools.gradle.compiler; +import com.google.common.base.Charsets; +import com.google.common.io.CharSink; import com.google.protobuf.gradle.ExecutableLocator; import com.google.protobuf.gradle.GenerateProtoTask; import io.spine.code.fs.java.DefaultJavaProject; import io.spine.code.fs.java.DefaultJavaProject.GeneratedRoot; import io.spine.code.proto.DescriptorReference; +import io.spine.io.Resource; import io.spine.tools.gradle.Artifact; import io.spine.tools.gradle.ConfigurationName; import io.spine.tools.gradle.GradleTask; @@ -40,14 +43,18 @@ import org.gradle.api.plugins.JavaPluginConvention; import java.io.File; +import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Base64; +import java.util.regex.Matcher; +import java.util.regex.Pattern; -import static com.google.common.base.Charsets.UTF_8; import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.io.Files.asCharSink; import static io.spine.code.fs.java.DefaultJavaProject.at; import static io.spine.tools.gradle.BaseTaskName.clean; +import static io.spine.tools.gradle.ConfigurationName.fetch; import static io.spine.tools.gradle.ModelCompilerTaskName.copyPluginJar; import static io.spine.tools.gradle.ModelCompilerTaskName.writeDescriptorReference; import static io.spine.tools.gradle.ModelCompilerTaskName.writePluginConfiguration; @@ -55,6 +62,9 @@ import static io.spine.tools.gradle.ModelCompilerTaskName.writeTestPluginConfiguration; import static io.spine.tools.gradle.ProtocPluginName.grpc; import static io.spine.tools.gradle.ProtocPluginName.spineProtoc; +import static io.spine.util.Exceptions.illegalStateWithCauseOf; +import static java.nio.charset.StandardCharsets.UTF_8; +import static java.nio.file.Files.createTempFile; import static org.gradle.internal.os.OperatingSystem.current; /** @@ -65,17 +75,16 @@ public final class JavaProtocConfigurationPlugin extends ProtocConfigurationPlug private static final String PLUGIN_ARTIFACT_PROPERTY = "Protoc plugin artifact"; private static final String JAR_EXTENSION = "jar"; - private static final String GRPC_GROUP = "io.grpc"; private static final String GRPC_PLUGIN_NAME = "protoc-gen-grpc-java"; - private static final String SH_EXTENSION = "sh"; - private static final String BAT_EXTENSION = "bat"; - private static final String SCRIPT_CLASSIFIER = "script"; + private static final String DOT_SH = ".sh"; + private static final String DOT_BAT = ".bat"; private static final String SPINE_PLUGIN_NAME = "spine-protoc-plugin"; + private static final Pattern JAR_FILE_INSERTION_POINT = Pattern.compile("\\{jar-file}"); @Override protected void - configureProtocPlugins(NamedDomainObjectContainer plugins) { + configureProtocPlugins(NamedDomainObjectContainer plugins, Project project) { plugins.create(grpc.name(), locator -> locator.setArtifact(Artifact.newBuilder() .setGroup(GRPC_GROUP) @@ -83,18 +92,36 @@ public final class JavaProtocConfigurationPlugin extends ProtocConfigurationPlug .setVersion(VERSIONS.grpc()) .build() .notation())); - plugins.create(spineProtoc.name(), locator -> { - boolean windows = current().isWindows(); - String scriptExt = windows ? BAT_EXTENSION : SH_EXTENSION; - locator.setArtifact(Artifact.newBuilder() - .useSpineToolsGroup() - .setName(SPINE_PLUGIN_NAME) - .setVersion(VERSIONS.spineBase()) - .setClassifier(SCRIPT_CLASSIFIER) - .setExtension(scriptExt) - .build() - .notation()); - }); + Dependency dependency = pluginJarDependency(project); + Path jarFile = project.getConfigurations() + .getByName(fetch.name()) + .fileCollection(dependency) + .getSingleFile() + .toPath() + .toAbsolutePath(); + plugins.create(spineProtoc.name(), + locator -> locator.setPath(tryWriteLaunchScript(jarFile).toString())); + } + + private static Path tryWriteLaunchScript(Path jarFile) { + try { + return writeLaunchScript(jarFile); + } catch (IOException e) { + throw illegalStateWithCauseOf(e); + } + } + + private static Path writeLaunchScript(Path jarFile) throws IOException { + boolean windows = current().isWindows(); + String scriptExt = windows ? DOT_BAT : DOT_SH; + Resource launcherTemplate = Resource.file("plugin_runner" + scriptExt); + String template = launcherTemplate.read(); + Matcher matcher = JAR_FILE_INSERTION_POINT.matcher(template); + String script = matcher.replaceAll(jarFile.toString()); + Path file = createTempFile(JavaProtocConfigurationPlugin.class.getSimpleName(), scriptExt); + CharSink sink = asCharSink(file.toFile(), UTF_8); + sink.write(script); + return file; } @Override @@ -125,7 +152,8 @@ private void customizeDescriptorSetGeneration(GenerateProtoTask protocTask) { .getPlugin(JavaPluginConvention.class); SourceScope sourceScope = tests ? SourceScope.test : SourceScope.main; File descriptorFile = new File(protocTask.getDescriptorPath()); - Path resourceDirectory = descriptorFile.toPath().getParent(); + Path resourceDirectory = descriptorFile.toPath() + .getParent(); javaConvention.getSourceSets() .getByName(sourceScope.name()) .getResources() @@ -169,6 +197,22 @@ private Task createCopyPluginJarTask(Project project) { return copyPluginJarTask; } + private Dependency pluginJarDependency(Project project) { + Configuration fetch = project.getConfigurations() + .maybeCreate(ConfigurationName.fetch.name()); + Artifact protocPluginArtifact = Artifact + .newBuilder() + .useSpineToolsGroup() + .setName(SPINE_PLUGIN_NAME) + .setVersion(VERSIONS.spineBase()) + .setExtension(JAR_EXTENSION) + .build(); + Dependency protocPluginDependency = project + .getDependencies() + .add(fetch.getName(), protocPluginArtifact.notation()); + return protocPluginDependency; + } + static File spineDirectory(Project project) { return at(project.getProjectDir()).tempArtifacts(); } @@ -211,7 +255,7 @@ private Task newWriteSpineProtocConfigTask(GenerateProtoTask protocTask, Path co private static String base64Encoded(String value) { Base64.Encoder encoder = Base64.getEncoder(); - byte[] valueBytes = value.getBytes(UTF_8); + byte[] valueBytes = value.getBytes(Charsets.UTF_8); String result = encoder.encodeToString(valueBytes); return result; } diff --git a/tools/model-compiler/src/main/resources/plugin_runner.bat b/tools/model-compiler/src/main/resources/plugin_runner.bat new file mode 100644 index 0000000000..c21bc1507a --- /dev/null +++ b/tools/model-compiler/src/main/resources/plugin_runner.bat @@ -0,0 +1,3 @@ +@echo off + +java -jar {jar-file} diff --git a/tools/model-compiler/src/main/resources/plugin_runner.sh b/tools/model-compiler/src/main/resources/plugin_runner.sh new file mode 100644 index 0000000000..a18ce9aa18 --- /dev/null +++ b/tools/model-compiler/src/main/resources/plugin_runner.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +java -jar {jar-file} diff --git a/tools/plugin-base/src/main/java/io/spine/tools/gradle/ProtocConfigurationPlugin.java b/tools/plugin-base/src/main/java/io/spine/tools/gradle/ProtocConfigurationPlugin.java index 16a1f7394e..a61c04aa6b 100644 --- a/tools/plugin-base/src/main/java/io/spine/tools/gradle/ProtocConfigurationPlugin.java +++ b/tools/plugin-base/src/main/java/io/spine/tools/gradle/ProtocConfigurationPlugin.java @@ -26,6 +26,7 @@ import com.google.protobuf.gradle.ProtobufConfigurator; import com.google.protobuf.gradle.ProtobufConfigurator.GenerateProtoTaskCollection; import com.google.protobuf.gradle.ProtobufConvention; +import io.spine.tools.groovy.ConsumerClosure; import io.spine.tools.groovy.GStrings; import org.gradle.api.NamedDomainObjectContainer; import org.gradle.api.Project; @@ -70,7 +71,10 @@ private void configureProtobuf(Project project, ProtobufConfigurator protobuf) { protocLocator.setArtifact(protobufCompiler() .ofVersion(version) .notation()))); - protobuf.plugins(closure(this::configureProtocPlugins)); + ConsumerClosure> pluginConfig = closure( + plugins -> configureProtocPlugins(plugins, project) + ); + protobuf.plugins(pluginConfig); protobuf.generateProtoTasks(closure(this::configureProtocTasks)); } @@ -95,12 +99,13 @@ private void configureProtocTasks(GenerateProtoTaskCollection tasks) { * * @param plugins * container of all plugins + * @param project * @apiNote overriding methods must invoke super to add the {@code spineProtoc} plugin, * which * is a required plugin */ protected abstract void - configureProtocPlugins(NamedDomainObjectContainer plugins); + configureProtocPlugins(NamedDomainObjectContainer plugins, Project project); private void configureProtocTask(GenerateProtoTask protocTask) { configureDescriptorSetGeneration(protocTask); diff --git a/tools/proto-dart-plugin/src/main/java/io/spine/generate/dart/DartProtocConfigurationPlugin.java b/tools/proto-dart-plugin/src/main/java/io/spine/generate/dart/DartProtocConfigurationPlugin.java index 2dd189cc84..91c536319a 100644 --- a/tools/proto-dart-plugin/src/main/java/io/spine/generate/dart/DartProtocConfigurationPlugin.java +++ b/tools/proto-dart-plugin/src/main/java/io/spine/generate/dart/DartProtocConfigurationPlugin.java @@ -52,7 +52,8 @@ protected File getTestDescriptorSet(Project project) { } @Override - protected void configureProtocPlugins(NamedDomainObjectContainer plugins) { + protected void configureProtocPlugins(NamedDomainObjectContainer plugins, + Project project) { Path executable = CachedDartProtocPlugin.locate(); plugins.create(dart.name(), locator -> locator.setPath(executable.toString())); } diff --git a/tools/proto-js-plugin/src/main/java/io/spine/js/gradle/JsProtocConfigurationPlugin.java b/tools/proto-js-plugin/src/main/java/io/spine/js/gradle/JsProtocConfigurationPlugin.java index c16ac319c6..bc0a533302 100644 --- a/tools/proto-js-plugin/src/main/java/io/spine/js/gradle/JsProtocConfigurationPlugin.java +++ b/tools/proto-js-plugin/src/main/java/io/spine/js/gradle/JsProtocConfigurationPlugin.java @@ -53,7 +53,8 @@ protected File getMainDescriptorSet(Project project) { } @Override - protected void configureProtocPlugins(NamedDomainObjectContainer plugins) { + protected void configureProtocPlugins(NamedDomainObjectContainer plugins, + Project project) { // Do nothing. } } From f01d85f1613dad6608a296822e97b0c8777ee110 Mon Sep 17 00:00:00 2001 From: Dmytro Dashenkov Date: Fri, 21 Aug 2020 17:25:20 +0300 Subject: [PATCH 03/13] Ensure script is executable --- .../JavaProtocConfigurationPlugin.java | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/JavaProtocConfigurationPlugin.java b/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/JavaProtocConfigurationPlugin.java index 02f16e31ac..c3feaea372 100644 --- a/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/JavaProtocConfigurationPlugin.java +++ b/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/JavaProtocConfigurationPlugin.java @@ -51,6 +51,7 @@ import java.util.regex.Pattern; import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.base.Preconditions.checkState; import static com.google.common.io.Files.asCharSink; import static io.spine.code.fs.java.DefaultJavaProject.at; import static io.spine.tools.gradle.BaseTaskName.clean; @@ -92,15 +93,17 @@ public final class JavaProtocConfigurationPlugin extends ProtocConfigurationPlug .setVersion(VERSIONS.grpc()) .build() .notation())); - Dependency dependency = pluginJarDependency(project); - Path jarFile = project.getConfigurations() - .getByName(fetch.name()) - .fileCollection(dependency) - .getSingleFile() - .toPath() - .toAbsolutePath(); - plugins.create(spineProtoc.name(), - locator -> locator.setPath(tryWriteLaunchScript(jarFile).toString())); + project.afterEvaluate(p -> { + Dependency dependency = pluginJarDependency(project); + Path jarFile = project.getConfigurations() + .getByName(fetch.name()) + .fileCollection(dependency) + .getSingleFile() + .toPath() + .toAbsolutePath(); + plugins.create(spineProtoc.name(), + locator -> locator.setPath(tryWriteLaunchScript(jarFile).toString())); + }); } private static Path tryWriteLaunchScript(Path jarFile) { @@ -118,10 +121,13 @@ private static Path writeLaunchScript(Path jarFile) throws IOException { String template = launcherTemplate.read(); Matcher matcher = JAR_FILE_INSERTION_POINT.matcher(template); String script = matcher.replaceAll(jarFile.toString()); - Path file = createTempFile(JavaProtocConfigurationPlugin.class.getSimpleName(), scriptExt); - CharSink sink = asCharSink(file.toFile(), UTF_8); + Path path = createTempFile(JavaProtocConfigurationPlugin.class.getSimpleName(), scriptExt); + File file = path.toFile(); + CharSink sink = asCharSink(file, UTF_8); sink.write(script); - return file; + boolean canBeExecuted = file.setExecutable(true, false); + checkState(canBeExecuted, "Failed to make file `%s` executable.", file); + return path; } @Override @@ -197,7 +203,7 @@ private Task createCopyPluginJarTask(Project project) { return copyPluginJarTask; } - private Dependency pluginJarDependency(Project project) { + private static Dependency pluginJarDependency(Project project) { Configuration fetch = project.getConfigurations() .maybeCreate(ConfigurationName.fetch.name()); Artifact protocPluginArtifact = Artifact From 2340363f39e77b4cd7e925bf8243c3d6260ea4d6 Mon Sep 17 00:00:00 2001 From: Dmytro Dashenkov Date: Fri, 21 Aug 2020 18:13:01 +0300 Subject: [PATCH 04/13] Update version --- config | 2 +- license-report.md | 60 +++++++++++++++++++++++----------------------- pom.xml | 4 ++-- version.gradle.kts | 2 +- 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/config b/config index c5e92c00fe..15df4f3934 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit c5e92c00fee4f2d255c46029d235cd78aacb94a3 +Subproject commit 15df4f3934ec0ce0a9a5d1be087df623f2d50598 diff --git a/license-report.md b/license-report.md index 10e8e4ea81..05a2bac5c4 100644 --- a/license-report.md +++ b/license-report.md @@ -1,6 +1,6 @@ -# Dependencies of `io.spine:spine-base:1.5.24` +# Dependencies of `io.spine:spine-base:1.5.26` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -329,12 +329,12 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 14:18:10 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 18:11:51 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-errorprone-checks:1.5.24` +# Dependencies of `io.spine.tools:spine-errorprone-checks:1.5.26` ## Runtime 1. **Group:** com.github.ben-manes.caffeine **Name:** caffeine **Version:** 2.7.0 @@ -785,12 +785,12 @@ This report was generated on **Fri Aug 21 14:18:10 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 14:18:11 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 18:11:51 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-javadoc-filter:1.5.24` +# Dependencies of `io.spine.tools:spine-javadoc-filter:1.5.26` ## Runtime 1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4 @@ -1169,12 +1169,12 @@ This report was generated on **Fri Aug 21 14:18:11 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 14:18:11 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 18:11:52 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-javadoc-prettifier:1.5.24` +# Dependencies of `io.spine.tools:spine-javadoc-prettifier:1.5.26` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -1545,12 +1545,12 @@ This report was generated on **Fri Aug 21 14:18:11 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 14:18:12 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 18:11:52 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-model-compiler:1.5.24` +# Dependencies of `io.spine.tools:spine-model-compiler:1.5.26` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -1937,12 +1937,12 @@ This report was generated on **Fri Aug 21 14:18:12 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 14:18:12 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 18:11:53 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-mute-logging:1.5.24` +# Dependencies of `io.spine.tools:spine-mute-logging:1.5.26` ## Runtime 1. **Group:** com.google.auto.value **Name:** auto-value-annotations **Version:** 1.6.3 @@ -2317,12 +2317,12 @@ This report was generated on **Fri Aug 21 14:18:12 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 14:18:13 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 18:11:53 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-plugin-base:1.5.24` +# Dependencies of `io.spine.tools:spine-plugin-base:1.5.26` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -2693,12 +2693,12 @@ This report was generated on **Fri Aug 21 14:18:13 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 14:18:13 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 18:11:53 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-plugin-testlib:1.5.24` +# Dependencies of `io.spine.tools:spine-plugin-testlib:1.5.26` ## Runtime 1. **Group:** com.google.auto.value **Name:** auto-value-annotations **Version:** 1.6.3 @@ -3123,12 +3123,12 @@ This report was generated on **Fri Aug 21 14:18:13 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 14:18:14 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 18:11:54 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-proto-dart-plugin:1.5.24` +# Dependencies of `io.spine.tools:spine-proto-dart-plugin:1.5.26` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -3499,12 +3499,12 @@ This report was generated on **Fri Aug 21 14:18:14 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 14:18:14 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 18:11:54 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-proto-js-plugin:1.5.24` +# Dependencies of `io.spine.tools:spine-proto-js-plugin:1.5.26` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -3875,12 +3875,12 @@ This report was generated on **Fri Aug 21 14:18:14 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 14:18:14 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 18:11:54 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-protoc-api:1.5.24` +# Dependencies of `io.spine.tools:spine-protoc-api:1.5.26` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -4201,12 +4201,12 @@ This report was generated on **Fri Aug 21 14:18:14 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 14:18:15 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 18:11:55 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-protoc-plugin:1.5.24` +# Dependencies of `io.spine.tools:spine-protoc-plugin:1.5.26` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -4545,12 +4545,12 @@ This report was generated on **Fri Aug 21 14:18:15 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 14:18:15 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 18:11:55 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine:spine-testlib:1.5.24` +# Dependencies of `io.spine:spine-testlib:1.5.26` ## Runtime 1. **Group:** com.google.auto.value **Name:** auto-value-annotations **Version:** 1.6.3 @@ -4925,12 +4925,12 @@ This report was generated on **Fri Aug 21 14:18:15 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 14:18:16 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 18:11:55 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-tool-base:1.5.24` +# Dependencies of `io.spine.tools:spine-tool-base:1.5.26` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -5269,12 +5269,12 @@ This report was generated on **Fri Aug 21 14:18:16 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 14:18:16 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Aug 21 18:11:56 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-validation-generator:1.5.24` +# Dependencies of `io.spine.tools:spine-validation-generator:1.5.26` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -5613,4 +5613,4 @@ This report was generated on **Fri Aug 21 14:18:16 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 14:18:16 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Fri Aug 21 18:11:56 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/pom.xml b/pom.xml index 345f08736b..6caa600aa8 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ all modules and does not describe the project structure per-subproject. io.spine spine-base -1.5.24 +1.5.26 2015 @@ -154,7 +154,7 @@ all modules and does not describe the project structure per-subproject. io.spine.tools spine-protoc-plugin - 1.5.24 + 1.5.26 test diff --git a/version.gradle.kts b/version.gradle.kts index a00893245e..56669201bd 100644 --- a/version.gradle.kts +++ b/version.gradle.kts @@ -25,7 +25,7 @@ * as we want to manage the versions in a single source. */ -val SPINE_VERSION = "1.5.24" +val SPINE_VERSION = "1.5.26" project.extra.apply { this["spineVersion"] = SPINE_VERSION From 351c08f096f7e683ec4680e90f93eec594f3a809 Mon Sep 17 00:00:00 2001 From: Dmytro Dashenkov Date: Wed, 26 Aug 2020 13:38:02 +0300 Subject: [PATCH 05/13] Remove `copyPluginJar` task --- license-report.md | 30 ++++---- .../tools/gradle/compiler/CopyPluginJar.java | 75 ------------------ .../JavaProtocConfigurationPlugin.java | 77 ++++--------------- .../tools/gradle/ModelCompilerTaskName.java | 5 -- 4 files changed, 32 insertions(+), 155 deletions(-) delete mode 100644 tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/CopyPluginJar.java diff --git a/license-report.md b/license-report.md index 05a2bac5c4..7f1f94069a 100644 --- a/license-report.md +++ b/license-report.md @@ -329,7 +329,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:51 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:29:35 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -785,7 +785,7 @@ This report was generated on **Fri Aug 21 18:11:51 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:51 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:29:38 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1169,7 +1169,7 @@ This report was generated on **Fri Aug 21 18:11:51 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:52 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:29:41 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1545,7 +1545,7 @@ This report was generated on **Fri Aug 21 18:11:52 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:52 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:29:43 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1937,7 +1937,7 @@ This report was generated on **Fri Aug 21 18:11:52 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:53 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:29:52 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -2317,7 +2317,7 @@ This report was generated on **Fri Aug 21 18:11:53 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:53 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:29:53 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -2693,7 +2693,7 @@ This report was generated on **Fri Aug 21 18:11:53 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:53 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:29:57 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -3123,7 +3123,7 @@ This report was generated on **Fri Aug 21 18:11:53 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:54 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:29:59 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -3499,7 +3499,7 @@ This report was generated on **Fri Aug 21 18:11:54 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:54 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:30:02 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -3875,7 +3875,7 @@ This report was generated on **Fri Aug 21 18:11:54 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:54 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:30:05 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -4201,7 +4201,7 @@ This report was generated on **Fri Aug 21 18:11:54 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:55 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:30:08 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -4545,7 +4545,7 @@ This report was generated on **Fri Aug 21 18:11:55 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:55 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:30:08 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -4925,7 +4925,7 @@ This report was generated on **Fri Aug 21 18:11:55 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:55 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:30:10 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -5269,7 +5269,7 @@ This report was generated on **Fri Aug 21 18:11:55 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:56 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:30:13 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -5613,4 +5613,4 @@ This report was generated on **Fri Aug 21 18:11:56 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:56 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Wed Aug 26 13:30:15 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/CopyPluginJar.java b/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/CopyPluginJar.java deleted file mode 100644 index 920b72a8a3..0000000000 --- a/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/CopyPluginJar.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2020, TeamDev. All rights reserved. - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.tools.gradle.compiler; - -import org.gradle.api.Action; -import org.gradle.api.GradleException; -import org.gradle.api.Project; -import org.gradle.api.Task; -import org.gradle.api.artifacts.Configuration; -import org.gradle.api.artifacts.Dependency; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; - -import static com.google.common.base.Preconditions.checkNotNull; -import static io.spine.tools.gradle.compiler.JavaProtocConfigurationPlugin.rootSpineDirectory; -import static io.spine.tools.gradle.compiler.JavaProtocConfigurationPlugin.spineDirectory; -import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; - -/** - * Downloads and lays out the {@code protoc} plugin executable JAR. - */ -public final class CopyPluginJar implements Action { - - private final Project project; - private final Dependency protocPluginDependency; - private final Configuration fetch; - - CopyPluginJar(Project project, Dependency protocPlugin, Configuration fetch) { - this.project = checkNotNull(project); - this.protocPluginDependency = checkNotNull(protocPlugin); - this.fetch = checkNotNull(fetch); - } - - @Override - public void execute(Task task) { - File executableJar = fetch.fileCollection(protocPluginDependency) - .getSingleFile(); - File spineDir = spineDirectory(project); - File rootSpineDir = rootSpineDirectory(project); - copy(executableJar, spineDir); - copy(executableJar, rootSpineDir); - } - - private static void copy(File file, File destinationDir) { - try { - destinationDir.mkdirs(); - Path destination = destinationDir.toPath() - .resolve(file.getName()); - Files.copy(file.toPath(), destination, REPLACE_EXISTING); - } catch (IOException e) { - throw new GradleException("Failed to copy Spine Protoc executable JAR.", e); - } - } -} diff --git a/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/JavaProtocConfigurationPlugin.java b/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/JavaProtocConfigurationPlugin.java index c3feaea372..8aaf2a25a4 100644 --- a/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/JavaProtocConfigurationPlugin.java +++ b/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/JavaProtocConfigurationPlugin.java @@ -34,7 +34,6 @@ import io.spine.tools.gradle.ProtocConfigurationPlugin; import io.spine.tools.gradle.SourceScope; import io.spine.tools.gradle.TaskName; -import org.gradle.api.Action; import org.gradle.api.NamedDomainObjectContainer; import org.gradle.api.Project; import org.gradle.api.Task; @@ -50,13 +49,11 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; import static com.google.common.io.Files.asCharSink; import static io.spine.code.fs.java.DefaultJavaProject.at; import static io.spine.tools.gradle.BaseTaskName.clean; import static io.spine.tools.gradle.ConfigurationName.fetch; -import static io.spine.tools.gradle.ModelCompilerTaskName.copyPluginJar; import static io.spine.tools.gradle.ModelCompilerTaskName.writeDescriptorReference; import static io.spine.tools.gradle.ModelCompilerTaskName.writePluginConfiguration; import static io.spine.tools.gradle.ModelCompilerTaskName.writeTestDescriptorReference; @@ -74,7 +71,6 @@ */ public final class JavaProtocConfigurationPlugin extends ProtocConfigurationPlugin { - private static final String PLUGIN_ARTIFACT_PROPERTY = "Protoc plugin artifact"; private static final String JAR_EXTENSION = "jar"; private static final String GRPC_GROUP = "io.grpc"; private static final String GRPC_PLUGIN_NAME = "protoc-gen-grpc-java"; @@ -106,6 +102,22 @@ public final class JavaProtocConfigurationPlugin extends ProtocConfigurationPlug }); } + private static Dependency pluginJarDependency(Project project) { + Configuration fetch = project.getConfigurations() + .maybeCreate(ConfigurationName.fetch.name()); + Artifact protocPluginArtifact = Artifact + .newBuilder() + .useSpineToolsGroup() + .setName(SPINE_PLUGIN_NAME) + .setVersion(VERSIONS.spineBase()) + .setExtension(JAR_EXTENSION) + .build(); + Dependency protocPluginDependency = project + .getDependencies() + .add(fetch.getName(), protocPluginArtifact.notation()); + return protocPluginDependency; + } + private static Path tryWriteLaunchScript(Path jarFile) { try { return writeLaunchScript(jarFile); @@ -135,7 +147,7 @@ protected void customizeTask(GenerateProtoTask protocTask) { customizeDescriptorSetGeneration(protocTask); Path spineProtocConfigPath = spineProtocConfigPath(protocTask); Task writeConfig = newWriteSpineProtocConfigTask(protocTask, spineProtocConfigPath); - protocTask.dependsOn(createCopyPluginJarTask(protocTask.getProject()), writeConfig); + protocTask.dependsOn(writeConfig); protocTask.getPlugins() .create(grpc.name()); protocTask.getPlugins() @@ -172,61 +184,6 @@ private void customizeDescriptorSetGeneration(GenerateProtoTask protocTask) { protocTask.finalizedBy(writeRef.getTask()); } - private Task createCopyPluginJarTask(Project project) { - Configuration fetch = project.getConfigurations() - .maybeCreate(ConfigurationName.fetch.name()); - Artifact protocPluginArtifact = Artifact - .newBuilder() - .useSpineToolsGroup() - .setName(SPINE_PLUGIN_NAME) - .setVersion(VERSIONS.spineBase()) - .setExtension(JAR_EXTENSION) - .build(); - Dependency protocPluginDependency = project - .getDependencies() - .add(fetch.getName(), protocPluginArtifact.notation()); - checkNotNull(protocPluginDependency, - "Could not create dependency %s %s", fetch.getName(), protocPluginArtifact); - Action action = new CopyPluginJar(project, protocPluginDependency, fetch); - - Task copyPluginJarTask = project.getTasks() - .findByPath(copyPluginJar.name()); - if (copyPluginJarTask == null) { - GradleTask copyPluginJarBuilder = newTask(copyPluginJar, action) - .allowNoDependencies() - .withInputProperty(PLUGIN_ARTIFACT_PROPERTY, protocPluginArtifact.notation()) - .withOutputFiles(project.fileTree(spineDirectory(project))) - .withOutputFiles(project.fileTree(rootSpineDirectory(project))) - .applyNowTo(project); - copyPluginJarTask = copyPluginJarBuilder.getTask(); - } - return copyPluginJarTask; - } - - private static Dependency pluginJarDependency(Project project) { - Configuration fetch = project.getConfigurations() - .maybeCreate(ConfigurationName.fetch.name()); - Artifact protocPluginArtifact = Artifact - .newBuilder() - .useSpineToolsGroup() - .setName(SPINE_PLUGIN_NAME) - .setVersion(VERSIONS.spineBase()) - .setExtension(JAR_EXTENSION) - .build(); - Dependency protocPluginDependency = project - .getDependencies() - .add(fetch.getName(), protocPluginArtifact.notation()); - return protocPluginDependency; - } - - static File spineDirectory(Project project) { - return at(project.getProjectDir()).tempArtifacts(); - } - - static File rootSpineDirectory(Project project) { - return at(project.getRootDir()).tempArtifacts(); - } - @Override protected File getTestDescriptorSet(Project project) { return Extension.getTestDescriptorSet(project); diff --git a/tools/plugin-base/src/main/java/io/spine/tools/gradle/ModelCompilerTaskName.java b/tools/plugin-base/src/main/java/io/spine/tools/gradle/ModelCompilerTaskName.java index 3da907de28..5af66a8c93 100644 --- a/tools/plugin-base/src/main/java/io/spine/tools/gradle/ModelCompilerTaskName.java +++ b/tools/plugin-base/src/main/java/io/spine/tools/gradle/ModelCompilerTaskName.java @@ -73,11 +73,6 @@ public enum ModelCompilerTaskName implements TaskName { */ mergeTestDescriptorSet, - /** - * Downloads the Protobuf compiler plugin executable JAR into the required paths in the project. - */ - copyPluginJar, - /** * Creates the Protobuf compiler plugin configuration. * From 94927cdf3a2ae7c3107084af1141f2675e8613a7 Mon Sep 17 00:00:00 2001 From: Dmytro Dashenkov Date: Wed, 26 Aug 2020 13:38:20 +0300 Subject: [PATCH 06/13] Update config --- .../main/kotlin/io/spine/gradle/internal/deps.kt | 14 +++++++++++++- .../main/kotlin/io/spine/gradle/internal/deps.kt | 14 +++++++++++++- .../main/kotlin/io/spine/gradle/internal/deps.kt | 14 +++++++++++++- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/base-validating-builders/buildSrc/src/main/kotlin/io/spine/gradle/internal/deps.kt b/base-validating-builders/buildSrc/src/main/kotlin/io/spine/gradle/internal/deps.kt index 163234f79f..3e9250e751 100644 --- a/base-validating-builders/buildSrc/src/main/kotlin/io/spine/gradle/internal/deps.kt +++ b/base-validating-builders/buildSrc/src/main/kotlin/io/spine/gradle/internal/deps.kt @@ -98,6 +98,10 @@ object Versions { val animalSniffer = "1.18" val apiguardian = "1.1.0" val javaxAnnotation = "1.3.2" + val klaxon = "5.4" + val ouathJwt = "3.10.3" + val bouncyCastlePkcs = "1.66" + val assertK = "0.22" /** * Version of the SLF4J library. @@ -159,7 +163,7 @@ object Build { object AutoService { val annotations = "com.google.auto.service:auto-service-annotations:${Versions.autoService}" - val processor = "com.google.auto.service:auto-service:${Versions.autoService}" + val processor = "com.google.auto.service:auto-service:${Versions.autoService}" } } @@ -168,6 +172,13 @@ object Gen { val javaxAnnotation = "javax.annotation:javax.annotation-api:${Versions.javaxAnnotation}" } +object Publishing { + val klaxon = "com.beust:klaxon:${Versions.klaxon}" + val oauthJwt = "com.auth0:java-jwt:${Versions.ouathJwt}" + val bouncyCastlePkcs = "org.bouncycastle:bcpkix-jdk15on:${Versions.bouncyCastlePkcs}" + val assertK = "com.willowtreeapps.assertk:assertk-jvm:${Versions.assertK}" +} + object Grpc { val core = "io.grpc:grpc-core:${Versions.grpc}" val stub = "io.grpc:grpc-stub:${Versions.grpc}" @@ -275,6 +286,7 @@ object Deps { val test = Test val versions = Versions val scripts = Scripts + val publishing = Publishing } object DependencyResolution { diff --git a/buildSrc/src/main/kotlin/io/spine/gradle/internal/deps.kt b/buildSrc/src/main/kotlin/io/spine/gradle/internal/deps.kt index 163234f79f..3e9250e751 100644 --- a/buildSrc/src/main/kotlin/io/spine/gradle/internal/deps.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/internal/deps.kt @@ -98,6 +98,10 @@ object Versions { val animalSniffer = "1.18" val apiguardian = "1.1.0" val javaxAnnotation = "1.3.2" + val klaxon = "5.4" + val ouathJwt = "3.10.3" + val bouncyCastlePkcs = "1.66" + val assertK = "0.22" /** * Version of the SLF4J library. @@ -159,7 +163,7 @@ object Build { object AutoService { val annotations = "com.google.auto.service:auto-service-annotations:${Versions.autoService}" - val processor = "com.google.auto.service:auto-service:${Versions.autoService}" + val processor = "com.google.auto.service:auto-service:${Versions.autoService}" } } @@ -168,6 +172,13 @@ object Gen { val javaxAnnotation = "javax.annotation:javax.annotation-api:${Versions.javaxAnnotation}" } +object Publishing { + val klaxon = "com.beust:klaxon:${Versions.klaxon}" + val oauthJwt = "com.auth0:java-jwt:${Versions.ouathJwt}" + val bouncyCastlePkcs = "org.bouncycastle:bcpkix-jdk15on:${Versions.bouncyCastlePkcs}" + val assertK = "com.willowtreeapps.assertk:assertk-jvm:${Versions.assertK}" +} + object Grpc { val core = "io.grpc:grpc-core:${Versions.grpc}" val stub = "io.grpc:grpc-stub:${Versions.grpc}" @@ -275,6 +286,7 @@ object Deps { val test = Test val versions = Versions val scripts = Scripts + val publishing = Publishing } object DependencyResolution { diff --git a/tools/smoke-tests/buildSrc/src/main/kotlin/io/spine/gradle/internal/deps.kt b/tools/smoke-tests/buildSrc/src/main/kotlin/io/spine/gradle/internal/deps.kt index 163234f79f..3e9250e751 100644 --- a/tools/smoke-tests/buildSrc/src/main/kotlin/io/spine/gradle/internal/deps.kt +++ b/tools/smoke-tests/buildSrc/src/main/kotlin/io/spine/gradle/internal/deps.kt @@ -98,6 +98,10 @@ object Versions { val animalSniffer = "1.18" val apiguardian = "1.1.0" val javaxAnnotation = "1.3.2" + val klaxon = "5.4" + val ouathJwt = "3.10.3" + val bouncyCastlePkcs = "1.66" + val assertK = "0.22" /** * Version of the SLF4J library. @@ -159,7 +163,7 @@ object Build { object AutoService { val annotations = "com.google.auto.service:auto-service-annotations:${Versions.autoService}" - val processor = "com.google.auto.service:auto-service:${Versions.autoService}" + val processor = "com.google.auto.service:auto-service:${Versions.autoService}" } } @@ -168,6 +172,13 @@ object Gen { val javaxAnnotation = "javax.annotation:javax.annotation-api:${Versions.javaxAnnotation}" } +object Publishing { + val klaxon = "com.beust:klaxon:${Versions.klaxon}" + val oauthJwt = "com.auth0:java-jwt:${Versions.ouathJwt}" + val bouncyCastlePkcs = "org.bouncycastle:bcpkix-jdk15on:${Versions.bouncyCastlePkcs}" + val assertK = "com.willowtreeapps.assertk:assertk-jvm:${Versions.assertK}" +} + object Grpc { val core = "io.grpc:grpc-core:${Versions.grpc}" val stub = "io.grpc:grpc-stub:${Versions.grpc}" @@ -275,6 +286,7 @@ object Deps { val test = Test val versions = Versions val scripts = Scripts + val publishing = Publishing } object DependencyResolution { From 37c2311da602c6411d973833e5785dbc2cede3ec Mon Sep 17 00:00:00 2001 From: Dmytro Dashenkov Date: Wed, 26 Aug 2020 13:51:54 +0300 Subject: [PATCH 07/13] Bump version to 1.5.27 --- config | 2 +- license-report.md | 60 +++++++++++++++++++++++----------------------- pom.xml | 4 ++-- version.gradle.kts | 2 +- 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/config b/config index 15df4f3934..a92f5382c8 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit 15df4f3934ec0ce0a9a5d1be087df623f2d50598 +Subproject commit a92f5382c816462dcfe7b4dc9aaab41aafc003ca diff --git a/license-report.md b/license-report.md index 05a2bac5c4..0de34f9b1d 100644 --- a/license-report.md +++ b/license-report.md @@ -1,6 +1,6 @@ -# Dependencies of `io.spine:spine-base:1.5.26` +# Dependencies of `io.spine:spine-base:1.5.27` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -329,12 +329,12 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:51 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:41:25 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-errorprone-checks:1.5.26` +# Dependencies of `io.spine.tools:spine-errorprone-checks:1.5.27` ## Runtime 1. **Group:** com.github.ben-manes.caffeine **Name:** caffeine **Version:** 2.7.0 @@ -785,12 +785,12 @@ This report was generated on **Fri Aug 21 18:11:51 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:51 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:41:28 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-javadoc-filter:1.5.26` +# Dependencies of `io.spine.tools:spine-javadoc-filter:1.5.27` ## Runtime 1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4 @@ -1169,12 +1169,12 @@ This report was generated on **Fri Aug 21 18:11:51 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:52 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:41:30 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-javadoc-prettifier:1.5.26` +# Dependencies of `io.spine.tools:spine-javadoc-prettifier:1.5.27` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -1545,12 +1545,12 @@ This report was generated on **Fri Aug 21 18:11:52 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:52 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:41:33 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-model-compiler:1.5.26` +# Dependencies of `io.spine.tools:spine-model-compiler:1.5.27` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -1937,12 +1937,12 @@ This report was generated on **Fri Aug 21 18:11:52 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:53 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:41:41 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-mute-logging:1.5.26` +# Dependencies of `io.spine.tools:spine-mute-logging:1.5.27` ## Runtime 1. **Group:** com.google.auto.value **Name:** auto-value-annotations **Version:** 1.6.3 @@ -2317,12 +2317,12 @@ This report was generated on **Fri Aug 21 18:11:53 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:53 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:41:42 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-plugin-base:1.5.26` +# Dependencies of `io.spine.tools:spine-plugin-base:1.5.27` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -2693,12 +2693,12 @@ This report was generated on **Fri Aug 21 18:11:53 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:53 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:41:46 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-plugin-testlib:1.5.26` +# Dependencies of `io.spine.tools:spine-plugin-testlib:1.5.27` ## Runtime 1. **Group:** com.google.auto.value **Name:** auto-value-annotations **Version:** 1.6.3 @@ -3123,12 +3123,12 @@ This report was generated on **Fri Aug 21 18:11:53 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:54 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:41:48 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-proto-dart-plugin:1.5.26` +# Dependencies of `io.spine.tools:spine-proto-dart-plugin:1.5.27` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -3499,12 +3499,12 @@ This report was generated on **Fri Aug 21 18:11:54 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:54 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:41:51 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-proto-js-plugin:1.5.26` +# Dependencies of `io.spine.tools:spine-proto-js-plugin:1.5.27` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -3875,12 +3875,12 @@ This report was generated on **Fri Aug 21 18:11:54 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:54 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:41:54 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-protoc-api:1.5.26` +# Dependencies of `io.spine.tools:spine-protoc-api:1.5.27` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -4201,12 +4201,12 @@ This report was generated on **Fri Aug 21 18:11:54 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:55 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:41:57 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-protoc-plugin:1.5.26` +# Dependencies of `io.spine.tools:spine-protoc-plugin:1.5.27` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -4545,12 +4545,12 @@ This report was generated on **Fri Aug 21 18:11:55 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:55 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:41:58 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine:spine-testlib:1.5.26` +# Dependencies of `io.spine:spine-testlib:1.5.27` ## Runtime 1. **Group:** com.google.auto.value **Name:** auto-value-annotations **Version:** 1.6.3 @@ -4925,12 +4925,12 @@ This report was generated on **Fri Aug 21 18:11:55 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:55 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:42:00 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-tool-base:1.5.26` +# Dependencies of `io.spine.tools:spine-tool-base:1.5.27` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -5269,12 +5269,12 @@ This report was generated on **Fri Aug 21 18:11:55 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:56 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 13:42:02 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-validation-generator:1.5.26` +# Dependencies of `io.spine.tools:spine-validation-generator:1.5.27` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -5613,4 +5613,4 @@ This report was generated on **Fri Aug 21 18:11:56 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Aug 21 18:11:56 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Wed Aug 26 13:42:05 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/pom.xml b/pom.xml index 6caa600aa8..77249425d0 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ all modules and does not describe the project structure per-subproject. io.spine spine-base -1.5.26 +1.5.27 2015 @@ -154,7 +154,7 @@ all modules and does not describe the project structure per-subproject. io.spine.tools spine-protoc-plugin - 1.5.26 + 1.5.27 test diff --git a/version.gradle.kts b/version.gradle.kts index 56669201bd..8609a1d222 100644 --- a/version.gradle.kts +++ b/version.gradle.kts @@ -25,7 +25,7 @@ * as we want to manage the versions in a single source. */ -val SPINE_VERSION = "1.5.26" +val SPINE_VERSION = "1.5.27" project.extra.apply { this["spineVersion"] = SPINE_VERSION From d6c2bb40b8b5cb9b8341eb5ed65cbe008f72c98b Mon Sep 17 00:00:00 2001 From: Dmytro Dashenkov Date: Wed, 26 Aug 2020 14:38:50 +0300 Subject: [PATCH 08/13] Delete `plugin_runner` artifacts --- tools/protoc-plugin/build.gradle.kts | 39 --------------------------- tools/protoc-plugin/plugin_runner.bat | 3 --- tools/protoc-plugin/plugin_runner.sh | 5 ---- 3 files changed, 47 deletions(-) delete mode 100644 tools/protoc-plugin/plugin_runner.bat delete mode 100644 tools/protoc-plugin/plugin_runner.sh diff --git a/tools/protoc-plugin/build.gradle.kts b/tools/protoc-plugin/build.gradle.kts index bbba0eb00b..7964c6d22d 100644 --- a/tools/protoc-plugin/build.gradle.kts +++ b/tools/protoc-plugin/build.gradle.kts @@ -19,7 +19,6 @@ */ import io.spine.gradle.internal.Deps -import java.nio.file.Files group = "io.spine.tools" @@ -52,41 +51,3 @@ tasks.jar { } }) } - -val shellRunner = injectVersion(file("plugin_runner.sh")) -val batchRunner = injectVersion(file("plugin_runner.bat")) - -artifacts { - archives(shellRunner) { - classifier = "script" - } - archives(batchRunner) { - classifier = "script" - } -} - -/** - * Inserts the current Spine version into the given file replacing the {@code {@literal {version}}} - * string. - * - *

This insertion point is conventional for the runner scripts for the Spine protoc plugin. - * - *

Before the runner script is published, the version must be injected into it. - * - *

The standard Grade filtering mechanism (involving the Copy task) cannot be used in this case - * since the injection should be performed on the configuration stage. - * - * @param scriptFile the script file to modify - * @return the new script file to publish - */ -fun injectVersion(scriptFile: File): File { - var text = scriptFile.readText() - text = text.replace("{version}", project.version as String) - val extension = when { - scriptFile.name.endsWith(".sh") -> ".sh" - else -> ".bat" - } - val tempFile = Files.createTempFile("build", extension) - tempFile.toFile().writeText(text) - return project.file(tempFile.toAbsolutePath()) -} diff --git a/tools/protoc-plugin/plugin_runner.bat b/tools/protoc-plugin/plugin_runner.bat deleted file mode 100644 index 2f0c10d197..0000000000 --- a/tools/protoc-plugin/plugin_runner.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off - -java -jar ./.spine/spine-protoc-plugin-{version}.jar diff --git a/tools/protoc-plugin/plugin_runner.sh b/tools/protoc-plugin/plugin_runner.sh deleted file mode 100644 index 777a998c02..0000000000 --- a/tools/protoc-plugin/plugin_runner.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -CURRENT_DIR="$(pwd)" - -java -jar "${CURRENT_DIR}"/.spine/spine-protoc-plugin-{version}.jar From 21148fc8f75ba3d1d550b081675e9dd78b1113fd Mon Sep 17 00:00:00 2001 From: Dmytro Dashenkov Date: Wed, 26 Aug 2020 15:02:35 +0300 Subject: [PATCH 09/13] Print error output upon failure in `rebuildProtobuf` --- .../io/spine/gradle/internal/RunBuild.kt | 2 +- license-report.md | 30 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/base-validating-builders/buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt b/base-validating-builders/buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt index 48dd298ef5..abc4259fbc 100644 --- a/base-validating-builders/buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt +++ b/base-validating-builders/buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt @@ -62,7 +62,7 @@ open class RunBuild : DefaultTask() { val process = buildProcess(command, errorOut, debugOut) if (process.waitFor() != 0) { - throw GradleException("Build FAILED. See $errorOut for details.") + throw GradleException("Build FAILED. Build log: ${errorOut.readText()}") } } diff --git a/license-report.md b/license-report.md index 0de34f9b1d..cc10127b63 100644 --- a/license-report.md +++ b/license-report.md @@ -329,7 +329,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Aug 26 13:41:25 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 14:44:28 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -785,7 +785,7 @@ This report was generated on **Wed Aug 26 13:41:25 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Aug 26 13:41:28 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 14:44:29 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1169,7 +1169,7 @@ This report was generated on **Wed Aug 26 13:41:28 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Aug 26 13:41:30 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 14:44:29 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1545,7 +1545,7 @@ This report was generated on **Wed Aug 26 13:41:30 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Aug 26 13:41:33 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 14:44:29 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1937,7 +1937,7 @@ This report was generated on **Wed Aug 26 13:41:33 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Aug 26 13:41:41 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 14:44:30 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -2317,7 +2317,7 @@ This report was generated on **Wed Aug 26 13:41:41 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Aug 26 13:41:42 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 14:44:30 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -2693,7 +2693,7 @@ This report was generated on **Wed Aug 26 13:41:42 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Aug 26 13:41:46 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 14:44:30 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -3123,7 +3123,7 @@ This report was generated on **Wed Aug 26 13:41:46 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Aug 26 13:41:48 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 14:44:31 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -3499,7 +3499,7 @@ This report was generated on **Wed Aug 26 13:41:48 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Aug 26 13:41:51 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 14:44:31 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -3875,7 +3875,7 @@ This report was generated on **Wed Aug 26 13:41:51 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Aug 26 13:41:54 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 14:44:31 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -4201,7 +4201,7 @@ This report was generated on **Wed Aug 26 13:41:54 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Aug 26 13:41:57 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 14:44:32 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -4545,7 +4545,7 @@ This report was generated on **Wed Aug 26 13:41:57 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Aug 26 13:41:58 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 14:44:32 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -4925,7 +4925,7 @@ This report was generated on **Wed Aug 26 13:41:58 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Aug 26 13:42:00 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 14:44:32 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -5269,7 +5269,7 @@ This report was generated on **Wed Aug 26 13:42:00 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Aug 26 13:42:02 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Wed Aug 26 14:44:33 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -5613,4 +5613,4 @@ This report was generated on **Wed Aug 26 13:42:02 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Aug 26 13:42:05 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Wed Aug 26 14:44:33 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file From 7aba2887846bfe1be279c3b7c1c90eaa1f8bf8bd Mon Sep 17 00:00:00 2001 From: Dmytro Dashenkov Date: Wed, 26 Aug 2020 15:10:42 +0300 Subject: [PATCH 10/13] Print error output upon failure in `rebuildProtobuf` --- buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt | 2 +- .../src/main/kotlin/io/spine/gradle/internal/RunBuild.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt b/buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt index 48dd298ef5..abc4259fbc 100644 --- a/buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt @@ -62,7 +62,7 @@ open class RunBuild : DefaultTask() { val process = buildProcess(command, errorOut, debugOut) if (process.waitFor() != 0) { - throw GradleException("Build FAILED. See $errorOut for details.") + throw GradleException("Build FAILED. Build log: ${errorOut.readText()}") } } diff --git a/tools/smoke-tests/buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt b/tools/smoke-tests/buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt index 48dd298ef5..abc4259fbc 100644 --- a/tools/smoke-tests/buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt +++ b/tools/smoke-tests/buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt @@ -62,7 +62,7 @@ open class RunBuild : DefaultTask() { val process = buildProcess(command, errorOut, debugOut) if (process.waitFor() != 0) { - throw GradleException("Build FAILED. See $errorOut for details.") + throw GradleException("Build FAILED. Build log: ${errorOut.readText()}") } } From 93d95b9c898e78c14d45513904a782d58ec3097e Mon Sep 17 00:00:00 2001 From: Dmytro Dashenkov Date: Wed, 26 Aug 2020 15:30:02 +0300 Subject: [PATCH 11/13] Fix path replacing on Windows --- .../tools/gradle/compiler/JavaProtocConfigurationPlugin.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/JavaProtocConfigurationPlugin.java b/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/JavaProtocConfigurationPlugin.java index 8aaf2a25a4..7479ae69aa 100644 --- a/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/JavaProtocConfigurationPlugin.java +++ b/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/JavaProtocConfigurationPlugin.java @@ -63,6 +63,7 @@ import static io.spine.util.Exceptions.illegalStateWithCauseOf; import static java.nio.charset.StandardCharsets.UTF_8; import static java.nio.file.Files.createTempFile; +import static java.util.regex.Matcher.quoteReplacement; import static org.gradle.internal.os.OperatingSystem.current; /** @@ -132,7 +133,7 @@ private static Path writeLaunchScript(Path jarFile) throws IOException { Resource launcherTemplate = Resource.file("plugin_runner" + scriptExt); String template = launcherTemplate.read(); Matcher matcher = JAR_FILE_INSERTION_POINT.matcher(template); - String script = matcher.replaceAll(jarFile.toString()); + String script = matcher.replaceAll(quoteReplacement(jarFile.toString())); Path path = createTempFile(JavaProtocConfigurationPlugin.class.getSimpleName(), scriptExt); File file = path.toFile(); CharSink sink = asCharSink(file, UTF_8); From ba0236b089f73215f3bc74edab94c106c7a0af41 Mon Sep 17 00:00:00 2001 From: Dmytro Dashenkov Date: Wed, 26 Aug 2020 15:48:47 +0300 Subject: [PATCH 12/13] Remove debug output --- .../src/main/kotlin/io/spine/gradle/internal/RunBuild.kt | 2 +- buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt | 2 +- .../src/main/kotlin/io/spine/gradle/internal/RunBuild.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/base-validating-builders/buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt b/base-validating-builders/buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt index abc4259fbc..48dd298ef5 100644 --- a/base-validating-builders/buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt +++ b/base-validating-builders/buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt @@ -62,7 +62,7 @@ open class RunBuild : DefaultTask() { val process = buildProcess(command, errorOut, debugOut) if (process.waitFor() != 0) { - throw GradleException("Build FAILED. Build log: ${errorOut.readText()}") + throw GradleException("Build FAILED. See $errorOut for details.") } } diff --git a/buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt b/buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt index abc4259fbc..48dd298ef5 100644 --- a/buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt @@ -62,7 +62,7 @@ open class RunBuild : DefaultTask() { val process = buildProcess(command, errorOut, debugOut) if (process.waitFor() != 0) { - throw GradleException("Build FAILED. Build log: ${errorOut.readText()}") + throw GradleException("Build FAILED. See $errorOut for details.") } } diff --git a/tools/smoke-tests/buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt b/tools/smoke-tests/buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt index abc4259fbc..48dd298ef5 100644 --- a/tools/smoke-tests/buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt +++ b/tools/smoke-tests/buildSrc/src/main/kotlin/io/spine/gradle/internal/RunBuild.kt @@ -62,7 +62,7 @@ open class RunBuild : DefaultTask() { val process = buildProcess(command, errorOut, debugOut) if (process.waitFor() != 0) { - throw GradleException("Build FAILED. Build log: ${errorOut.readText()}") + throw GradleException("Build FAILED. See $errorOut for details.") } } From bd7c6eb7f5ed5afe2235f4463005bce0713b48ac Mon Sep 17 00:00:00 2001 From: Dmytro Dashenkov Date: Wed, 26 Aug 2020 16:57:28 +0300 Subject: [PATCH 13/13] Add a param description --- .../java/io/spine/tools/gradle/ProtocConfigurationPlugin.java | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/plugin-base/src/main/java/io/spine/tools/gradle/ProtocConfigurationPlugin.java b/tools/plugin-base/src/main/java/io/spine/tools/gradle/ProtocConfigurationPlugin.java index a61c04aa6b..5e763d53e2 100644 --- a/tools/plugin-base/src/main/java/io/spine/tools/gradle/ProtocConfigurationPlugin.java +++ b/tools/plugin-base/src/main/java/io/spine/tools/gradle/ProtocConfigurationPlugin.java @@ -100,6 +100,7 @@ private void configureProtocTasks(GenerateProtoTaskCollection tasks) { * @param plugins * container of all plugins * @param project + * the target project in which the codegen occurs * @apiNote overriding methods must invoke super to add the {@code spineProtoc} plugin, * which * is a required plugin