From a78e9e937972a220131f95a35b0f043f8be9f9ee Mon Sep 17 00:00:00 2001 From: Alexander Pann Date: Sun, 29 Sep 2024 09:24:09 +0200 Subject: [PATCH] fix some small issues --- api/mps-gradle-plugin.api | 168 ++++++++++++------ .../de/itemis/mps/gradle/common.gradle.kts | 13 +- .../itemis/mps/gradle/downloadJBR/Plugin.kt | 5 +- 3 files changed, 123 insertions(+), 63 deletions(-) diff --git a/api/mps-gradle-plugin.api b/api/mps-gradle-plugin.api index f5f9d1b..891f09b 100644 --- a/api/mps-gradle-plugin.api +++ b/api/mps-gradle-plugin.api @@ -30,31 +30,32 @@ public class de/itemis/mps/gradle/BuildLanguages : de/itemis/mps/gradle/RunAntSc public fun ()V } -public class de/itemis/mps/gradle/BundleMacosJdk : org/gradle/api/DefaultTask, groovy/lang/GroovyObject { - public static synthetic field __$stMC Z - protected synthetic fun $getStaticMetaClass ()Lgroovy/lang/MetaClass; +public class de/itemis/mps/gradle/BundleMacosJdk : org/gradle/api/DefaultTask { + public field jdk Ljava/io/File; + public field outputFile Ljava/io/File; + public field rcpArtifact Ljava/io/File; public fun ()V - public fun build ()Ljava/lang/Object; - public fun getJdk ()Ljava/io/File; - public fun getJdkDirname ()Ljava/lang/String; - public fun getMetaClass ()Lgroovy/lang/MetaClass; - public fun getOutputFile ()Ljava/io/File; - public fun getRcpArtifact ()Ljava/io/File; - public fun setJdk (Ljava/lang/Object;)Ljava/lang/Object; - public fun setJdkDependency (Ljava/lang/Object;)Ljava/lang/Object; - public fun setJdkDirname (Ljava/lang/String;)Ljava/lang/Object; - public fun setMetaClass (Lgroovy/lang/MetaClass;)V - public fun setOutputFile (Ljava/lang/Object;)Ljava/lang/Object; - public fun setRcpArtifact (Ljava/lang/Object;)Ljava/lang/Object; + public final fun build ()V + public final fun getJdk ()Ljava/io/File; + public final fun getJdkDirname ()Ljava/lang/String; + public final fun getOutputFile ()Ljava/io/File; + public final fun getRcpArtifact ()Ljava/io/File; + public final fun setJdk (Ljava/io/File;)V + public final fun setJdkDependency (Ljava/lang/Object;)V + public final fun setJdkDirname (Ljava/lang/String;)V + public final fun setOutputFile (Ljava/io/File;)V + public final fun setOutputFile (Ljava/lang/Object;)V + public final fun setRcpArtifact (Ljava/io/File;)V +} + +public final class de/itemis/mps/gradle/BundledScripts { + public static final field Companion Lde/itemis/mps/gradle/BundledScripts$Companion; + public fun ()V + public static final fun extractScriptsToDir (Ljava/io/File;[Ljava/lang/String;)V } -public class de/itemis/mps/gradle/BundledScripts : groovy/lang/GroovyObject { - public static synthetic field __$stMC Z - protected synthetic fun $getStaticMetaClass ()Lgroovy/lang/MetaClass; - public fun ()V - public static fun extractScriptsToDir (Ljava/io/File;[Ljava/lang/String;)V - public fun getMetaClass ()Lgroovy/lang/MetaClass; - public fun setMetaClass (Lgroovy/lang/MetaClass;)V +public final class de/itemis/mps/gradle/BundledScripts$Companion { + public final fun extractScriptsToDir (Ljava/io/File;[Ljava/lang/String;)V } public final class de/itemis/mps/gradle/CommonKt { @@ -72,28 +73,44 @@ public final class de/itemis/mps/gradle/CommonPlugin : org/gradle/api/Plugin { public fun apply (Lorg/gradle/api/Project;)V } -public class de/itemis/mps/gradle/CreateDmg : org/gradle/api/DefaultTask, groovy/lang/GroovyObject { - public static synthetic field __$stMC Z - protected synthetic fun $getStaticMetaClass ()Lgroovy/lang/MetaClass; +public abstract class de/itemis/mps/gradle/Common_gradle$CI { + public fun (Lorg/gradle/api/Project;)V + public final fun buildNumber ()I + public final fun determineCI ()V + public final fun get_project ()Lorg/gradle/api/Project; + public final fun isCI ()Ljava/lang/Object; + public final fun registerDependencyRepositories (Ljava/util/ArrayList;)V +} + +public abstract class de/itemis/mps/gradle/Common_gradle$Directories { + public fun (Lorg/gradle/api/Project;)V + public final fun artifactsDir ()Ljava/io/File; + public final fun get_project ()Lorg/gradle/api/Project; + public final fun jnLibraryPath ()Ljava/io/File; + public final fun scriptFile (Ljava/lang/String;)Ljava/io/File; +} + +public abstract class de/itemis/mps/gradle/Common_gradle$GitHubAuth { + public fun (Lorg/gradle/api/Project;)V + public final fun getToken ()Ljava/lang/String; + public final fun getUser ()Ljava/lang/String; +} + +public abstract class de/itemis/mps/gradle/Common_gradle$Itemis { public fun ()V - public fun build ()Ljava/lang/Object; - public fun getBackgroundImage ()Ljava/io/File; - public fun getDmgFile ()Ljava/io/File; - public fun getJdk ()Ljava/io/File; - public fun getMetaClass ()Lgroovy/lang/MetaClass; - public fun getRcpArtifact ()Ljava/io/File; - public fun getSignIdentity ()Ljava/lang/String; - public fun getSignKeyChain ()Ljava/io/File; - public fun getSignKeyChainPassword ()Ljava/lang/String; - public fun setBackgroundImage (Ljava/lang/Object;)Ljava/lang/Object; - public fun setDmgFile (Ljava/lang/Object;)Ljava/lang/Object; - public fun setJdk (Ljava/lang/Object;)Ljava/lang/Object; - public fun setJdkDependency (Ljava/lang/Object;)Ljava/lang/Object; - public fun setMetaClass (Lgroovy/lang/MetaClass;)V - public fun setRcpArtifact (Ljava/lang/Object;)Ljava/lang/Object; - public fun setSignIdentity (Ljava/lang/String;)V - public fun setSignKeyChain (Ljava/lang/Object;)Ljava/lang/Object; - public fun setSignKeyChainPassword (Ljava/lang/String;)V + public final fun itemisNexus ()Ljava/lang/String; + public final fun mbeddrGitHub ()Ljava/lang/String; +} + +public abstract class de/itemis/mps/gradle/Common_gradle$JDK { + public fun (Lorg/gradle/api/Project;)V + public final fun determine (Lorg/gradle/api/JavaVersion;)V + public final fun get_project ()Lorg/gradle/api/Project; +} + +public final class de/itemis/mps/gradle/Common_gradle$inlined$sam$i$org_gradle_api_Action$0 : org/gradle/api/Action { + public fun (Lkotlin/jvm/functions/Function1;)V + public final synthetic fun execute (Ljava/lang/Object;)V } public final class de/itemis/mps/gradle/EnvironmentKind : java/lang/Enum { @@ -118,15 +135,23 @@ public class de/itemis/mps/gradle/GenerateLibrariesXml : org/gradle/api/DefaultT public fun setOverrides (Ljava/lang/Object;)V } -public class de/itemis/mps/gradle/GetMpsInBrowser : org/gradle/api/DefaultTask, groovy/lang/GroovyObject { - public static synthetic field __$stMC Z - protected synthetic fun $getStaticMetaClass ()Lgroovy/lang/MetaClass; +public class de/itemis/mps/gradle/GetMpsInBrowser : org/gradle/api/DefaultTask { public fun ()V - public fun build ()Ljava/lang/Object; - public fun getMetaClass ()Lgroovy/lang/MetaClass; - public fun getVersion ()Ljava/lang/String; - public fun setMetaClass (Lgroovy/lang/MetaClass;)V - public fun setVersion (Ljava/lang/String;)Ljava/lang/Object; + public final fun build ()V + public final fun getVersion ()Ljava/lang/String; + public final fun setVersion (Ljava/lang/String;)V +} + +public final class de/itemis/mps/gradle/MPSVersion { + public static final field Companion Lde/itemis/mps/gradle/MPSVersion$Companion; + public synthetic fun (Lnet/swiftzer/semver/SemVer;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun getVersion ()Lnet/swiftzer/semver/SemVer; + public final fun toMavenSnapshot ()Ljava/lang/String; + public fun toString ()Ljava/lang/String; +} + +public final class de/itemis/mps/gradle/MPSVersion$Companion { + public final fun parse (Ljava/lang/String;)Lde/itemis/mps/gradle/MPSVersion; } public final class de/itemis/mps/gradle/Macro { @@ -159,14 +184,10 @@ public final class de/itemis/mps/gradle/Plugin { public fun toString ()Ljava/lang/String; } -public class de/itemis/mps/gradle/Pom : groovy/lang/GroovyObject { - public static synthetic field __$stMC Z - protected synthetic fun $getStaticMetaClass ()Lgroovy/lang/MetaClass; +public final class de/itemis/mps/gradle/Pom { public fun ()V - public fun getMetaClass ()Lgroovy/lang/MetaClass; - public fun setMetaClass (Lgroovy/lang/MetaClass;)V - public fun withDep (Lorg/gradle/api/publish/maven/MavenPom;Lorg/gradle/api/artifacts/Configuration;)Ljava/lang/Object; - public fun withProvidedDep (Lorg/gradle/api/publish/maven/MavenPom;Lorg/gradle/api/artifacts/Configuration;)Ljava/lang/Object; + public final fun withDep (Lorg/gradle/api/publish/maven/MavenPom;Lorg/gradle/api/artifacts/Configuration;)V + public final fun withProvidedDep (Lorg/gradle/api/publish/maven/MavenPom;Lorg/gradle/api/artifacts/Configuration;)V } public class de/itemis/mps/gradle/RunAntScript : org/gradle/api/DefaultTask { @@ -197,12 +218,43 @@ public class de/itemis/mps/gradle/TestLanguages : de/itemis/mps/gradle/RunAntScr public fun ()V } +public class de/itemis/mps/gradle/de/itemis/mps/gradle/CreateDmg : org/gradle/api/DefaultTask { + public field backgroundImage Ljava/io/File; + public field dmgFile Ljava/io/File; + public field jdk Ljava/io/File; + public field rcpArtifact Ljava/io/File; + public fun ()V + public final fun build ()V + public final fun getBackgroundImage ()Ljava/io/File; + public final fun getDmgFile ()Ljava/io/File; + public final fun getJdk ()Ljava/io/File; + public final fun getRcpArtifact ()Ljava/io/File; + public final fun getSignIdentity ()Ljava/lang/String; + public final fun getSignKeyChain ()Ljava/io/File; + public final fun getSignKeyChainPassword ()Ljava/lang/String; + public final fun setBackgroundImage (Ljava/io/File;)V + public final fun setBackgroundImage (Ljava/lang/Object;)V + public final fun setDmgFile (Ljava/io/File;)V + public final fun setDmgFile (Ljava/lang/Object;)V + public final fun setJdk (Ljava/io/File;)V + public final fun setJdk (Ljava/lang/Object;)V + public final fun setJdkDependency (Ljava/lang/Object;)V + public final fun setRcpArtifact (Ljava/io/File;)V + public final fun setRcpArtifact (Ljava/lang/Object;)V + public final fun setSignIdentity (Ljava/lang/String;)V + public final fun setSignKeyChain (Ljava/io/File;)V + public final fun setSignKeyChain (Ljava/lang/Object;)V + public final fun setSignKeyChainPassword (Ljava/lang/String;)V +} + public class de/itemis/mps/gradle/downloadJBR/DownloadJbrConfiguration { public field jbrVersion Ljava/lang/String; public fun (Lorg/gradle/api/model/ObjectFactory;)V + public final fun getDefaultJavaExecutable ()Z public final fun getDistributionType ()Ljava/lang/String; public final fun getDownloadDir ()Ljava/io/File; public final fun getJbrVersion ()Ljava/lang/String; + public final fun setDefaultJavaExecutable (Z)V public final fun setDistributionType (Ljava/lang/String;)V public final fun setDownloadDir (Ljava/io/File;)V public final fun setJbrVersion (Ljava/lang/String;)V diff --git a/src/main/kotlin/de/itemis/mps/gradle/common.gradle.kts b/src/main/kotlin/de/itemis/mps/gradle/common.gradle.kts index 5c4a989..7a6f38e 100644 --- a/src/main/kotlin/de/itemis/mps/gradle/common.gradle.kts +++ b/src/main/kotlin/de/itemis/mps/gradle/common.gradle.kts @@ -126,10 +126,15 @@ if (project.extra["skipResolveMps"].toString().toBoolean()) { } } else { tasks.register("commonResolveMps") { - dependsOn(configurations.getByName("mps")) - dependsOn(configurations.getByName("common_mps")) - from(configurations.getByName("mps").resolve().map { zipTree(it) }) - from(configurations.getByName("common_mps").resolve().map { zipTree(it) }) + if(configurations.findByName("mps")!= null) { + dependsOn(configurations.getByName("mps")) + from(configurations.getByName("mps").resolve().map { zipTree(it) }) + } + if(configurations.findByName("common_mps")!= null) { + dependsOn(configurations.getByName("common_mps")) + from(configurations.getByName("common_mps").resolve().map { zipTree(it) }) + } + project.extra["mpsHomeDir"]?.let { into(it) } } } diff --git a/src/main/kotlin/de/itemis/mps/gradle/downloadJBR/Plugin.kt b/src/main/kotlin/de/itemis/mps/gradle/downloadJBR/Plugin.kt index 16a770a..cb49e01 100644 --- a/src/main/kotlin/de/itemis/mps/gradle/downloadJBR/Plugin.kt +++ b/src/main/kotlin/de/itemis/mps/gradle/downloadJBR/Plugin.kt @@ -6,6 +6,7 @@ import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.file.DirectoryProperty import org.gradle.api.model.ObjectFactory +import org.gradle.kotlin.dsl.extra import java.io.File import javax.inject.Inject @@ -15,6 +16,7 @@ open class DownloadJbrConfiguration @Inject constructor(objects: ObjectFactory) var distributionType : String? = null internal val downloadDirProperty: DirectoryProperty = objects.directoryProperty() + @Suppress("unused") var downloadDir: File? get() = downloadDirProperty.get().asFile set(value) { @@ -22,6 +24,7 @@ open class DownloadJbrConfiguration @Inject constructor(objects: ObjectFactory) } } +@Suppress("unused") open class DownloadJbrProjectPlugin : Plugin { override fun apply(project: Project) { project.run { @@ -86,7 +89,7 @@ open class DownloadJbrProjectPlugin : Plugin { )) javaExecutableProperty.set(jbrDirProperty.file(if (Os.isFamily(Os.FAMILY_WINDOWS)) "bin/java.exe" else "bin/java")) if(extension.defaultJavaExecutable) { - project.setProperty("itemis.mps.gradle.ant.defaultJavaExecutable",javaExecutableProperty.asFile) + project.extra["itemis.mps.gradle.ant.defaultJavaExecutable"] = javaExecutableProperty.asFile } } }