@@ -16,7 +16,7 @@ plugins {
1616}
1717
1818val defaultGroupId = " cz.sazel.sqldelight"
19- val versionBase = " 0.4 .0"
19+ val versionBase = " 0.5 .0"
2020
2121val localProperties = Properties ().apply {
2222 try {
@@ -47,14 +47,12 @@ repositories {
4747 }
4848}
4949
50- kotlin {
50+ lateinit var publicationsFromMainHost : List < String >
5151
5252
53- js(IR ) {
54- compilations.all {
55- kotlinOptions.moduleKind = " commonjs"
56- }
53+ kotlin {
5754
55+ js(IR ) {
5856 useCommonJs()
5957 nodejs {
6058 kotlinNodeJsEnvSpec.version.set(libs.versions.node.js.get())
@@ -84,7 +82,7 @@ kotlin {
8482 dependencies {
8583 implementation(libs.sqldelight.runtime.js)
8684 implementation(libs.sqldelight.async.extensions.js)
87- implementation(npm(" sqlite3" , libs.versions.node.sqlite3.get(), false ))
85+ implementation(npm(" sqlite3" , libs.versions.node.sqlite3.get()))
8886 }
8987 }
9088 val jsTest by getting {
@@ -98,7 +96,7 @@ kotlin {
9896 }
9997 }
10098
101- val publicationsFromMainHost = listOf (js()).map { it.name } + " kotlinMultiplatform"
99+ publicationsFromMainHost = listOf (js()).map { it.name } + " kotlinMultiplatform"
102100
103101 dokka {
104102 moduleName = " node-sqlite3-driver"
@@ -111,94 +109,95 @@ kotlin {
111109 }
112110 }
113111
114- val javadocJar = tasks.register<Jar >(" javadocJar" ) {
115- dependsOn(tasks.dokkaGenerate.get())
116- archiveClassifier.set(" javadoc" )
117- from(layout.buildDirectory.dir(" dokka/html" ))
118- }
119112
120- publishing {
113+ }
114+ }
121115
122- publications {
123- matching { it.name in publicationsFromMainHost }.all {
124- val targetPublication = this @all
125- tasks.withType<AbstractPublishToMaven >().matching { it.publication == targetPublication }
126- .configureEach { onlyIf { findProperty(" isMainHost" ) == " true" } }
127- }
116+ val javadocJar = tasks.register<Jar >(" javadocJar" ) {
117+ dependsOn(tasks.dokkaGenerate.get())
118+ archiveClassifier.set(" javadoc" )
119+ from(layout.buildDirectory.dir(" dokka/html" ))
120+ }
128121
122+ publishing {
123+ publications {
124+ matching { it.name in publicationsFromMainHost }.all {
125+ val targetPublication = this @all
126+ tasks.withType<AbstractPublishToMaven >().matching { it.publication == targetPublication }
127+ .configureEach { onlyIf { findProperty(" isMainHost" ) == " true" } }
128+ }
129129
130- withType<MavenPublication > {
131- artifact(javadocJar)
132-
133- pom {
134- name.set(" node-sqlite3-driver" )
135- description.set(" Driver for the library SQLDelight that supports sqlite3 Node.js module" )
136- licenses {
137- license {
138- name.set(" Apache-2.0" )
139- url.set(" https://opensource.org/licenses/Apache-2.0" )
140- }
141- }
142- url.set(" https://github.com/wojta/sqldelight-node-sqlite3-driver" )
143- issueManagement {
144- system.set(" Github" )
145- url.set(" https://github.com/wojta/sqldelight-node-sqlite3-driver/issues" )
146- }
147- scm {
148- connection.set(" https://github.com/wojta/sqldelight-node-sqlite3-driver.git" )
149- url.set(" https://github.com/wojta/sqldelight-node-sqlite3-driver" )
150- }
151- developers {
152- developer {
153- name.set(" Vojtěch Sázel" )
154- email.set(" sqldelight@sazel.cz" )
155- }
156- }
157- }
158- }
159130
160- }
131+ withType<MavenPublication > {
132+ artifact(javadocJar)
161133
162- repositories {
163- val githubUserName = System .getenv(" GITHUB_USER" ) ? : localProperties[" github.user" ] as String?
164- if (githubUserName != null ) { // Github packages repo
165- maven {
166- name = " GitHubPackages"
167- url = uri(" https://maven.pkg.github.com/wojta/sqldelight-node-sqlite3-driver" ) // Github Package
168-
169- credentials {
170- // Fetch these details from the properties file or from Environment variables
171- username = githubUserName
172- password = System .getenv(" GITHUB_TOKEN" ) ? : localProperties[" github.token" ] as String?
173- }
134+ pom {
135+ name.set(" node-sqlite3-driver" )
136+ description.set(" Driver for the library SQLDelight that supports sqlite3 Node.js module" )
137+ licenses {
138+ license {
139+ name.set(" Apache-2.0" )
140+ url.set(" https://opensource.org/licenses/Apache-2.0" )
174141 }
175142 }
176- maven { // OSS Sonatype (default)
177- val isSnapshot = version.toString().endsWith(" SNAPSHOT" )
178- val destination = if (! isSnapshot) {
179- " https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
180- } else " https://s01.oss.sonatype.org/content/repositories/snapshots"
181- url = uri(destination)
182- credentials {
183- username = System .getenv(" SONATYPE_USER" ) ? : localProperties[" sonatype.user" ] as String?
184- password = System .getenv(" SONATYPE_PASSWORD" ) ? : localProperties[" sonatype.password" ] as String?
143+ url.set(" https://github.com/wojta/sqldelight-node-sqlite3-driver" )
144+ issueManagement {
145+ system.set(" Github" )
146+ url.set(" https://github.com/wojta/sqldelight-node-sqlite3-driver/issues" )
147+ }
148+ scm {
149+ connection.set(" https://github.com/wojta/sqldelight-node-sqlite3-driver.git" )
150+ url.set(" https://github.com/wojta/sqldelight-node-sqlite3-driver" )
151+ }
152+ developers {
153+ developer {
154+ name.set(" Vojtěch Sázel" )
155+ email.set(" sqldelight@sazel.cz" )
185156 }
186157 }
187- mavenLocal()
188158 }
189159 }
190160
191- signing {
192- useInMemoryPgpKeys(
193- System .getenv(" GPG_KEY_SECRET" ) ? : localProperties[" gpg.keySecret" ] as String? ,
194- System .getenv(" GPG_KEY_PASSWORD" ) ? : localProperties[" gpg.keyPassword" ] as String?
195- )
161+ }
196162
197- sign(publishing.publications)
163+ repositories {
164+ val githubUserName = System .getenv(" GITHUB_USER" ) ? : localProperties[" github.user" ] as String?
165+ if (githubUserName != null ) { // Github packages repo
166+ maven {
167+ name = " GitHubPackages"
168+ url = uri(" https://maven.pkg.github.com/wojta/sqldelight-node-sqlite3-driver" ) // Github Package
169+
170+ credentials {
171+ // Fetch these details from the properties file or from Environment variables
172+ username = githubUserName
173+ password = System .getenv(" GITHUB_TOKEN" ) ? : localProperties[" github.token" ] as String?
174+ }
175+ }
176+ }
177+ maven { // OSS Sonatype (default)
178+ val isSnapshot = version.toString().endsWith(" SNAPSHOT" )
179+ val destination = if (! isSnapshot) {
180+ " https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
181+ } else " https://s01.oss.sonatype.org/content/repositories/snapshots"
182+ url = uri(destination)
183+ credentials {
184+ username = System .getenv(" SONATYPE_USER" ) ? : localProperties[" sonatype.user" ] as String?
185+ password = System .getenv(" SONATYPE_PASSWORD" ) ? : localProperties[" sonatype.password" ] as String?
186+ }
198187 }
188+ mavenLocal()
199189 }
200190}
201191
192+ signing {
193+ useInMemoryPgpKeys(
194+ System .getenv(" GPG_KEY_SECRET" ) ? : localProperties[" gpg.keySecret" ] as String? ,
195+ System .getenv(" GPG_KEY_PASSWORD" ) ? : localProperties[" gpg.keyPassword" ] as String?
196+ )
197+
198+ sign(publishing.publications)
199+ }
200+
202201// workaround for missing sqlite3 bindings
203202val bindingsInstall = tasks.register(" sqlite3BindingsInstall" ) {
204203 doFirst {
0 commit comments