update type of exposed library

This commit is contained in:
InsanusMokrassar 2020-04-10 13:12:55 +06:00
parent 15157fa4c3
commit d0b0cad94c
3 changed files with 96 additions and 62 deletions

View File

@ -1,6 +1,3 @@
project.version = "$core_version"
project.group = "com.insanusmokrassar"
buildscript { buildscript {
repositories { repositories {
mavenLocal() mavenLocal()
@ -15,9 +12,13 @@ buildscript {
} }
} }
apply plugin: 'java-library' plugins {
apply plugin: 'kotlinx-serialization' id "org.jetbrains.kotlin.multiplatform" version "$kotlin_version"
apply plugin: 'kotlin' id "org.jetbrains.kotlin.plugin.serialization" version "$kotlin_version"
}
project.version = "$core_version"
project.group = "com.insanusmokrassar"
apply from: "publish.gradle" apply from: "publish.gradle"
@ -28,8 +29,14 @@ repositories {
maven { url "https://kotlin.bintray.com/kotlinx" } maven { url "https://kotlin.bintray.com/kotlinx" }
} }
dependencies { kotlin {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" jvm()
js()
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib')
api "org.jetbrains.exposed:exposed-core:$exposed_version" api "org.jetbrains.exposed:exposed-core:$exposed_version"
api "com.soywiz.korlibs.klock:klock:$klockVersion" api "com.soywiz.korlibs.klock:klock:$klockVersion"
@ -38,8 +45,21 @@ dependencies {
} else { } else {
implementation project(":postssystem.core") implementation project(":postssystem.core")
} }
}
}
commonTest {
dependencies {
implementation kotlin('test-common')
implementation kotlin('test-annotations-common')
}
}
jvmTest {
dependencies {
implementation kotlin('test-junit')
implementation "org.xerial:sqlite-jdbc:$test_sqlite_version"
}
}
}
testImplementation "org.xerial:sqlite-jdbc:$test_sqlite_version"
testImplementation "org.junit.jupiter:junit-jupiter-api:$test_junit_version"
} }

View File

@ -1,25 +1,24 @@
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
task sourcesJar(type: Jar) { task javadocsJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
task javadocJar(type: Jar) {
from javadoc
classifier = 'javadoc' classifier = 'javadoc'
} }
publishing { afterEvaluate {
publications { project.publishing.publications.all {
maven(MavenPublication) { // rename artifacts
from components.java
groupId "${project.group}" groupId "${project.group}"
artifactId "${project.name}" if (it.name.contains('kotlinMultiplatform')) {
version "${project.version}" artifactId = "${project.name}"
} else {
artifactId = "${project.name}-$name"
}
}
}
artifact sourcesJar publishing {
artifact javadocJar publications.all {
artifact javadocsJar
pom.withXml { pom.withXml {
asNode().children().last() + { asNode().children().last() + {
@ -55,5 +54,4 @@ publishing {
} }
} }
} }
}
} }

View File

@ -2,23 +2,29 @@ apply plugin: 'com.jfrog.bintray'
apply from: "maven.publish.gradle" apply from: "maven.publish.gradle"
ext {
projectBintrayDir = "${project.group}/".replace(".", "/") + "${project.name}/${project.version}"
}
bintray { bintray {
user = project.hasProperty('BINTRAY_USER') ? project.property('BINTRAY_USER') : System.getenv('BINTRAY_USER') user = project.hasProperty('BINTRAY_USER') ? project.property('BINTRAY_USER') : System.getenv('BINTRAY_USER')
key = project.hasProperty('BINTRAY_KEY') ? project.property('BINTRAY_KEY') : System.getenv('BINTRAY_KEY') key = project.hasProperty('BINTRAY_KEY') ? project.property('BINTRAY_KEY') : System.getenv('BINTRAY_KEY')
publications = ["maven"]
filesSpec { filesSpec {
into "$projectBintrayDir" from "${buildDir}/publications/"
from("build/libs") { eachFile {
include "**/*.asc" String directorySubname = it.getFile().parentFile.name
if (it.getName() == "module.json") {
if (directorySubname == "kotlinMultiplatform") {
it.setPath("${project.name}/${project.version}/${project.name}-${project.version}.module")
} else {
it.setPath("${project.name}-${directorySubname}/${project.version}/${project.name}-${directorySubname}-${project.version}.module")
} }
from("build/publications/maven") { } else {
rename 'pom-default.xml(.*)', "${project.name}-${project.version}.pom\$1" if (directorySubname == "kotlinMultiplatform" && it.getName() == "pom-default.xml") {
it.setPath("${project.name}/${project.version}/${project.name}-${project.version}.pom")
} else {
it.exclude()
} }
} }
}
into "${project.group}".replace(".", "/")
}
pkg { pkg {
repo = "InsanusMokrassar" repo = "InsanusMokrassar"
name = "${project.name}" name = "${project.name}"
@ -36,4 +42,14 @@ bintray {
} }
} }
bintrayUpload.doFirst {
publications = publishing.publications.collect {
if (it.name.contains('kotlinMultiplatform')) {
null
} else {
it.name
}
} - null
}
bintrayUpload.dependsOn publishToMavenLocal bintrayUpload.dependsOn publishToMavenLocal