File: 041-libraries-kotlinx-metadata-jvm-convert-kts-to-groovy.patch

package info (click to toggle)
kotlin 1.3.31%2Bds1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 109,908 kB
  • sloc: java: 454,756; xml: 18,599; javascript: 10,452; sh: 513; python: 97; makefile: 69; ansic: 4
file content (191 lines) | stat: -rw-r--r-- 6,886 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
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
Forwarded: not-needed
Last-Update: 2021-04-22

---
 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()