From: Samyak Jain <samyak.jn11@gmail.com>
Date: Fri, 25 Sep 2020 21:36:13 +0000
Subject: libraries/kotlinx-metadata-jvm: Convert kts to groovy

---
 libraries/kotlinx-metadata/jvm/build.gradle     | 84 +++++++++++++++++++++++++
 libraries/kotlinx-metadata/jvm/build.gradle.kts | 82 ------------------------
 2 files changed, 84 insertions(+), 82 deletions(-)
 create mode 100644 libraries/kotlinx-metadata/jvm/build.gradle
 delete mode 100644 libraries/kotlinx-metadata/jvm/build.gradle.kts

diff --git a/libraries/kotlinx-metadata/jvm/build.gradle b/libraries/kotlinx-metadata/jvm/build.gradle
new file mode 100644
index 0000000..0b014a9
--- /dev/null
+++ b/libraries/kotlinx-metadata/jvm/build.gradle
@@ -0,0 +1,84 @@
+import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
+
+
+plugins {
+    id("org.jetbrains.kotlin.jvm")
+    id("jps-compatible")
+}
+
+description = "Kotlin JVM metadata manipulation library"
+/*
+ * To publish this library use `:kotlinx-metadata-jvm:publish` task and specify the following parameters
+ *
+ *      - `-PdeployVersion=1.2.nn`: the version of the standard library dependency to put into .pom
+ *      - `-PkotlinxMetadataDeployVersion=0.0.n`: the version of the library itself
+ *      - `-PdeployRepoUrl=repository_url`: (optional) the url of repository to deploy to;
+ *          if not specified, the local directory repository `build/repo` will be used
+ *      - `-PdeployRepoUsername=username`: (optional) the username to authenticate in the deployment repository
+ *      - `-PdeployRepoPassword=password`: (optional) the password to authenticate in the deployment repository
+ */
+
+group = "org.jetbrains.kotlinx"
+version = "0.0.4"
+
+sourceSets {
+    "main" {
+        java.srcDirs("src")
+        resources.srcDir("resources")
+    }
+    "test" {
+        java.srcDirs("test", "tests")
+    }
+}
+configurations.create("shadows") {
+    setTransitive(false)
+}
+configurations.getByName("compileOnly").extendsFrom(configurations.shadows)
+configurations.getByName("testCompile").extendsFrom(configurations.shadows)
+
+dependencies {
+    compile(DependenciesKt.customKotlinStdlib(project,null))
+    shadows project(":kotlinx-metadata")
+    shadows project(":core:metadata")
+    shadows project(":core:metadata.jvm")
+    shadows(DependenciesKt.customProtobufLite(project))
+    testCompile(DependenciesKt.customCommonDep(project,"junit:junit"))
+//  testCompile(intellijDep()) { includeJars("asm-all", rootProject = rootProject) }
+	testCompile(IntellijDependenciesKt.getIntellijDep(project,"intellij")) { IntellijDependenciesKt.customIncludeJars(it,["asm-all"], rootProject) }
+    testRuntime(project(":kotlin-reflect"))
+}
+
+ArtifactsKt.customNoDefaultJar(project)
+
+task("shadowJar",type: ShadowJar) {
+    CommonUtilKt.customCallGroovy(project,"manifestAttributes", [manifest, project])
+    manifest.attributes["Implementation-Version"] = version
+
+    from(SourceSetsKt.customMainSourceSet(project).output)
+    exclude("**/*.proto")
+    configurations = [project.configurations."shadows"]
+    relocate("org.jetbrains.kotlin", "kotlinx.metadata.internal")
+
+    ext.artifactRef = outputs.files.getSingleFile()
+    ArtifactsKt.customRuntimeJarArtifactBy(project, it, artifactRef) {}
+    def task = it
+    project.artifacts.add("runtime", artifactRef) {
+        builtBy(task)
+    }
+}
+
+/*
+ArtifactsKt.customSourcesJar(project,"main") {
+    for (dependency in shadows.dependencies) {
+        if (dependency == ProjectDependency) {
+            ext.javaPlugin = dependency.dependencyProject.convention.findPlugin(JavaPluginConvention::class.java)
+            if (javaPlugin != null) {
+                from(javaPlugin.sourceSets["main"].allSource)
+            }
+        }
+    }
+}
+*/
+ArtifactsKt.customSourcesJar(project,"main") {}
+
+//javadocJar()
diff --git a/libraries/kotlinx-metadata/jvm/build.gradle.kts b/libraries/kotlinx-metadata/jvm/build.gradle.kts
deleted file mode 100644
index f7b55a1..0000000
--- a/libraries/kotlinx-metadata/jvm/build.gradle.kts
+++ /dev/null
@@ -1,82 +0,0 @@
-import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
-
-description = "Kotlin JVM metadata manipulation library"
-
-plugins {
-    kotlin("jvm")
-    id("jps-compatible")
-}
-
-/*
- * To publish this library use `:kotlinx-metadata-jvm:publish` task and specify the following parameters
- *
- *      - `-PdeployVersion=1.2.nn`: the version of the standard library dependency to put into .pom
- *      - `-PkotlinxMetadataDeployVersion=0.0.n`: the version of the library itself
- *      - `-PdeployRepoUrl=repository_url`: (optional) the url of repository to deploy to;
- *          if not specified, the local directory repository `build/repo` will be used
- *      - `-PdeployRepoUsername=username`: (optional) the username to authenticate in the deployment repository
- *      - `-PdeployRepoPassword=password`: (optional) the password to authenticate in the deployment repository
- */
-group = "org.jetbrains.kotlinx"
-val deployVersion = findProperty("kotlinxMetadataDeployVersion") as String?
-version = deployVersion ?: "0.1-SNAPSHOT"
-
-jvmTarget = "1.6"
-javaHome = rootProject.extra["JDK_16"] as String
-
-sourceSets {
-    "main" { projectDefault() }
-    "test" { projectDefault() }
-}
-
-val shadows by configurations.creating {
-    isTransitive = false
-}
-configurations.getByName("compileOnly").extendsFrom(shadows)
-configurations.getByName("testCompile").extendsFrom(shadows)
-
-dependencies {
-    compile(kotlinStdlib())
-    shadows(project(":kotlinx-metadata"))
-    shadows(project(":core:metadata"))
-    shadows(project(":core:metadata.jvm"))
-    shadows(protobufLite())
-    testCompile(commonDep("junit:junit"))
-    testCompile(intellijDep()) { includeJars("asm-all", rootProject = rootProject) }
-    testCompileOnly(project(":kotlin-reflect-api"))
-    testRuntime(project(":kotlin-reflect"))
-}
-
-
-if (deployVersion != null) {
-    publish()
-}
-
-noDefaultJar()
-
-task<ShadowJar>("shadowJar") {
-    callGroovy("manifestAttributes", manifest, project)
-    manifest.attributes["Implementation-Version"] = version
-
-    from(mainSourceSet.output)
-    exclude("**/*.proto")
-    configurations = listOf(shadows)
-    relocate("org.jetbrains.kotlin", "kotlinx.metadata.internal")
-
-    val artifactRef = outputs.files.singleFile
-    runtimeJarArtifactBy(this, artifactRef)
-    addArtifact("runtime", this, artifactRef)
-}
-
-sourcesJar {
-    for (dependency in shadows.dependencies) {
-        if (dependency is ProjectDependency) {
-            val javaPlugin = dependency.dependencyProject.convention.findPlugin(JavaPluginConvention::class.java)
-            if (javaPlugin != null) {
-                from(javaPlugin.sourceSets["main"].allSource)
-            }
-        }
-    }
-}
-
-javadocJar()
