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

View File

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

View File

@ -2,23 +2,29 @@ apply plugin: 'com.jfrog.bintray'
apply from: "maven.publish.gradle"
ext {
projectBintrayDir = "${project.group}/".replace(".", "/") + "${project.name}/${project.version}"
}
bintray {
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')
publications = ["maven"]
filesSpec {
into "$projectBintrayDir"
from("build/libs") {
include "**/*.asc"
from "${buildDir}/publications/"
eachFile {
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") {
rename 'pom-default.xml(.*)', "${project.name}-${project.version}.pom\$1"
} else {
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 {
repo = "InsanusMokrassar"
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