1
+ package com.github.lamba92.dragalialost.build
2
+
3
+ import com.jfrog.bintray.gradle.BintrayExtension
4
+ import org.gradle.api.Plugin
5
+ import org.gradle.api.Project
6
+ import org.gradle.kotlin.dsl.configure
7
+ import org.gradle.kotlin.dsl.withGroovyBuilder
8
+ import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
9
+
10
+ @Suppress(" unused" )
11
+ class DragaliaPlugin : Plugin <Project > {
12
+
13
+ private val kotlinVersion = " 1.3.50"
14
+ private val bintrayVersion = " 1.8.4"
15
+
16
+ override fun apply (target : Project ) = with (target) {
17
+
18
+ plugins.apply (" org.jetbrains.kotlin.multiplatform" )
19
+ plugins.apply (" org.gradle.maven-publish" )
20
+ plugins.apply (" com.jfrog.bintray" )
21
+
22
+ extensions.findByName(" buildScan" )?.withGroovyBuilder {
23
+ setProperty(" termsOfServiceUrl" , " https://gradle.com/terms-of-service" )
24
+ setProperty(" termsOfServiceAgree" , " yes" )
25
+ }
26
+
27
+ extensions.configure<KotlinMultiplatformExtension > {
28
+ metadata {
29
+ mavenPublication {
30
+ artifactId = " ${rootProject.name} -${project.name} -metadata"
31
+ }
32
+ }
33
+
34
+ jvm {
35
+ compilations.all {
36
+ kotlinOptions {
37
+ jvmTarget = " 1.8"
38
+ }
39
+ }
40
+ mavenPublication {
41
+ artifactId = " ${rootProject.name} -${project.name} -jvm"
42
+ }
43
+ }
44
+
45
+ js {
46
+ // nodejs()
47
+ mavenPublication {
48
+ artifactId = " ${rootProject.name} -${project.name} -js"
49
+ }
50
+ }
51
+
52
+ sourceSets.all {
53
+ languageSettings.enableLanguageFeature(" InlineClasses" )
54
+ }
55
+
56
+ }
57
+
58
+ extensions.configure<BintrayExtension > {
59
+ user = searchPropertyOrNull(" bintrayUsername" )
60
+ key = searchPropertyOrNull(" bintrayApiKey" )
61
+ pkg {
62
+ version {
63
+ name = project.version.toString()
64
+ }
65
+ repo = " com.github.lamba92"
66
+ name = " dragalia-library"
67
+ setLicenses(" Apache-2.0" )
68
+ vcsUrl = " https://github.com/lamba92/dragalia-library"
69
+ issueTrackerUrl = " https://github.com/lamba92/dragalia-library/issues"
70
+ }
71
+ publish = true
72
+ setPublications(" jvm" , " js" , " kotlinMultiplatform" )
73
+ }
74
+
75
+ }
76
+
77
+ }
0 commit comments