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,18 +29,37 @@ repositories {
maven { url "https://kotlin.bintray.com/kotlinx" }
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
api "org.jetbrains.exposed:exposed-core:$exposed_version"
api "com.soywiz.korlibs.klock:klock:$klockVersion"
kotlin {
jvm()
js()
if ((project.hasProperty('RELEASE_MODE') && project.property('RELEASE_MODE') == "true") || System.getenv('RELEASE_MODE') == "true") {
api "com.insanusmokrassar:postssystem.core:$core_version"
} else {
implementation project(":postssystem.core")
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib')
api "org.jetbrains.exposed:exposed-core:$exposed_version"
api "com.soywiz.korlibs.klock:klock:$klockVersion"
if ((project.hasProperty('RELEASE_MODE') && project.property('RELEASE_MODE') == "true") || System.getenv('RELEASE_MODE') == "true") {
api "com.insanusmokrassar:postssystem.core:$core_version"
} else {
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,40 +1,39 @@
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'
}
afterEvaluate {
project.publishing.publications.all {
// rename artifacts
groupId "${project.group}"
if (it.name.contains('kotlinMultiplatform')) {
artifactId = "${project.name}"
} else {
artifactId = "${project.name}-$name"
}
}
}
publishing {
publications {
maven(MavenPublication) {
from components.java
groupId "${project.group}"
artifactId "${project.name}"
version "${project.version}"
publications.all {
artifact javadocsJar
artifact sourcesJar
artifact javadocJar
pom.withXml {
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
pom.withXml {
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
description "Exposed realisation for PostsSystem Core"
name "PostsSystem Core Exposed realization"
url "https://git.insanusmokrassar.com/PostsSystem/Core/"
description "Exposed realisation for PostsSystem Core"
name "PostsSystem Core Exposed realization"
url "https://git.insanusmokrassar.com/PostsSystem/Core/"
scm {
developerConnection "scm:git:[fetch=]https://git.insanusmokrassar.com/PostsSystem/Core/.git[push=]https://git.insanusmokrassar.com/PostsSystem/Core/.git"
url "https://git.insanusmokrassar.com/PostsSystem/Core/.git"
}
scm {
developerConnection "scm:git:[fetch=]https://git.insanusmokrassar.com/PostsSystem/Core/.git[push=]https://git.insanusmokrassar.com/PostsSystem/Core/.git"
url "https://git.insanusmokrassar.com/PostsSystem/Core/.git"
}
developers {
developers {
developer {
id "InsanusMokrassar"
@ -42,16 +41,15 @@ publishing {
email "ovsyannikov.alexey95@gmail.com"
}
}
}
licenses {
licenses {
license {
name "Apache Software License 2.0"
url "https://git.insanusmokrassar.com/PostsSystem/Core/src/master/LICENSE"
}
}
}
}
}

View File

@ -2,22 +2,28 @@ 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("build/publications/maven") {
rename 'pom-default.xml(.*)', "${project.name}-${project.version}.pom\$1"
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")
}
} 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"
@ -36,4 +42,14 @@ bintray {
}
}
bintrayUpload.doFirst {
publications = publishing.publications.collect {
if (it.name.contains('kotlinMultiplatform')) {
null
} else {
it.name
}
} - null
}
bintrayUpload.dependsOn publishToMavenLocal