Space publishing

This commit is contained in:
Alexander Nozik 2020-07-05 14:39:35 +03:00
parent 7a282fa207
commit 615b06eb8c
13 changed files with 270 additions and 260 deletions

View File

@ -4,10 +4,11 @@ plugins {
`kotlin-dsl` `kotlin-dsl`
`maven-publish` `maven-publish`
id("com.jfrog.bintray") version "1.8.5" id("com.jfrog.bintray") version "1.8.5"
id("org.jetbrains.changelog") version "0.3.2"
} }
group = "scientifik" group = "scientifik"
version = "0.5.0" version = "0.5.1"
repositories { repositories {
gradlePluginPortal() gradlePluginPortal()
@ -55,12 +56,6 @@ gradlePlugin {
description = "Pre-configured JS project" description = "Pre-configured JS project"
implementationClass = "scientifik.ScientifikJSPlugin" implementationClass = "scientifik.ScientifikJSPlugin"
} }
// create("scientifik-atomic") {
// id = "scientifik.atomic"
// description = "Add kotlin atomic plugin to any flafor"
// implementationClass = "scientifik.ScientifikAtomicPlugin"
// }
} }
} }

Binary file not shown.

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

2
gradlew vendored
View File

@ -82,6 +82,7 @@ esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM. # Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@ -129,6 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"` APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"` JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath # We build the pattern for arguments to be converted via cygpath

1
gradlew.bat vendored
View File

@ -84,6 +84,7 @@ set CMD_LINE_ARGS=%*
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle @rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

View File

@ -4,14 +4,14 @@ import org.gradle.api.JavaVersion
* Build constants * Build constants
*/ */
object Scientifik { object Scientifik {
const val coroutinesVersion = "1.3.4" const val coroutinesVersion = "1.3.7"
const val serializationVersion = "0.20.0" const val serializationVersion = "0.20.0"
const val atomicVersion = "0.14.3"
val JVM_TARGET = JavaVersion.VERSION_11 val JVM_TARGET = JavaVersion.VERSION_1_8
// val JVM_VERSION = JVM_TARGET.toString()
object Serialization{ object Serialization{
const val xmlVersion = "0.20.0.0" const val xmlVersion = "0.20.0.1"
const val yamlVersion = "0.16.1" const val yamlVersion = "0.16.1"
const val bsonVersion = "0.2.1" const val bsonVersion = "0.2.1"
} }

View File

@ -10,9 +10,7 @@ import org.gradle.kotlin.dsl.getting
import org.jetbrains.kotlin.gradle.dsl.KotlinJsProjectExtension import org.jetbrains.kotlin.gradle.dsl.KotlinJsProjectExtension
open class ScientifikJSPlugin : Plugin<Project> { open class ScientifikJSPlugin : Plugin<Project> {
override fun apply(project: Project) { override fun apply(project: Project): Unit = project.run {
with(project) {
plugins.apply("org.jetbrains.kotlin.js") plugins.apply("org.jetbrains.kotlin.js")
repositories.applyRepos() repositories.applyRepos()
@ -64,5 +62,4 @@ open class ScientifikJSPlugin : Plugin<Project> {
} }
} }
}
} }

View File

@ -15,8 +15,7 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
open class ScientifikJVMPlugin : Plugin<Project> { open class ScientifikJVMPlugin : Plugin<Project> {
override fun apply(project: Project) { override fun apply(project: Project): Unit = project.run {
with(project) {
plugins.apply("org.jetbrains.kotlin.jvm") plugins.apply("org.jetbrains.kotlin.jvm")
repositories.applyRepos() repositories.applyRepos()
@ -67,7 +66,7 @@ open class ScientifikJVMPlugin : Plugin<Project> {
} }
pluginManager.withPlugin("org.jetbrains.dokka") { pluginManager.withPlugin("org.jetbrains.dokka") {
logger.info("Adding dokka functionality to project ${this@with.name}") logger.info("Adding dokka functionality to project ${project.name}")
val dokka by tasks.getting(DokkaTask::class) { val dokka by tasks.getting(DokkaTask::class) {
outputFormat = "html" outputFormat = "html"
@ -92,10 +91,9 @@ open class ScientifikJVMPlugin : Plugin<Project> {
} }
} }
} }
tasks.withType<Test>(){ tasks.withType<Test>() {
useJUnitPlatform() useJUnitPlatform()
} }
} }
}
} }

View File

@ -14,8 +14,7 @@ import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
open class ScientifikMPPlugin : Plugin<Project> { open class ScientifikMPPlugin : Plugin<Project> {
override fun apply(project: Project) { override fun apply(project: Project): Unit = project.run {
project.run {
plugins.apply("org.jetbrains.kotlin.multiplatform") plugins.apply("org.jetbrains.kotlin.multiplatform")
@ -136,5 +135,4 @@ open class ScientifikMPPlugin : Plugin<Project> {
} }
} }
}
} }

View File

@ -15,14 +15,14 @@ open class ScientifikPublishPlugin : Plugin<Project> {
project.plugins.apply("maven-publish") project.plugins.apply("maven-publish")
project.run { project.afterEvaluate {
val githubProject = findProperty("githubProject") as? String val githubProject = findProperty("githubProject") as? String
val vcs = findProperty("vcs") as? String val vcs = findProperty("vcs") as? String
?: githubProject?.let { "https://github.com/mipt-npm/$it" } ?: githubProject?.let { "https://github.com/mipt-npm/$it" }
if (vcs == null) { if (vcs == null) {
project.logger.warn("[${project.name}] Missing deployment configuration. Skipping publish.") project.logger.warn("[${project.name}] Missing deployment configuration. Skipping publish.")
return@apply return@afterEvaluate
} }
project.configure<PublishingExtension> { project.configure<PublishingExtension> {
@ -75,6 +75,24 @@ open class ScientifikPublishPlugin : Plugin<Project> {
} }
} }
val spaceRepo: String? by project
val spaceUser: String? by project
val spaceToken: String? by project
if (spaceRepo != null && spaceUser != null && spaceToken != null) {
project.logger.info("Adding mipt-npm Space publishing to project [${project.name}]")
repositories {
maven {
name = "space"
url = uri(spaceRepo!!)
credentials {
username = spaceUser
password = spaceToken
}
}
}
}
val bintrayOrg = project.findProperty("bintrayOrg") as? String ?: "mipt-npm" val bintrayOrg = project.findProperty("bintrayOrg") as? String ?: "mipt-npm"
val bintrayUser = project.findProperty("bintrayUser") as? String val bintrayUser = project.findProperty("bintrayUser") as? String

View File

@ -21,7 +21,7 @@ enum class DependencySourceSet(val setName: String, val suffix: String) {
internal fun Project.useDependency( internal fun Project.useDependency(
vararg pairs: Pair<String, String>, vararg pairs: Pair<String, String>,
dependencySourceSet: DependencySourceSet = DependencySourceSet.MAIN, dependencySourceSet: DependencySourceSet = DependencySourceSet.MAIN,
dependencyConfiguration: DependencyConfiguration = DependencyConfiguration.API dependencyConfiguration: DependencyConfiguration = DependencyConfiguration.IMPLEMENTATION
) { ) {
pluginManager.withPlugin("org.jetbrains.kotlin.multiplatform") { pluginManager.withPlugin("org.jetbrains.kotlin.multiplatform") {
extensions.findByType<KotlinMultiplatformExtension>()?.apply { extensions.findByType<KotlinMultiplatformExtension>()?.apply {
@ -86,12 +86,12 @@ fun Project.useCoroutines(
dependencyConfiguration = configuration dependencyConfiguration = configuration
) )
//fun Project.atomic(version: String = Scientifik.atomicfuVersion) { fun Project.useAtomic(version: String = Scientifik.atomicVersion) {
// plugins.apply("kotlinx-atomicfu") plugins.apply("kotlinx-atomicfu")
// useDependency( useDependency(
// "commonMain" to "org.jetbrains.kotlinx:atomicfu-common:$version", "commonMain" to "org.jetbrains.kotlinx:atomicfu-common:$version",
// "jvmMain" to "org.jetbrains.kotlinx:atomicfu:$version", "jvmMain" to "org.jetbrains.kotlinx:atomicfu:$version",
// "jsMain" to "org.jetbrains.kotlinx:atomicfu-js:$version", "jsMain" to "org.jetbrains.kotlinx:atomicfu-js:$version",
// "nativeMain" to "org.jetbrains.kotlinx:atomicfu-native:$version" "nativeMain" to "org.jetbrains.kotlinx:atomicfu-native:$version"
// ) )
//} }

View File

@ -30,7 +30,7 @@ val defaultPlatform: FXPlatform = when {
else -> error("Platform not recognized") else -> error("Platform not recognized")
} }
fun KotlinDependencyHandler.addFXDependencies( private fun KotlinDependencyHandler.addFXDependencies(
vararg modules: FXModule, vararg modules: FXModule,
configuration: DependencyConfiguration, configuration: DependencyConfiguration,
version: String = "14", version: String = "14",

View File

@ -83,7 +83,8 @@ fun Project.useSerialization(
"jvm" to "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$version", "jvm" to "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$version",
"js" to "org.jetbrains.kotlinx:kotlinx-serialization-runtime-js:$version", "js" to "org.jetbrains.kotlinx:kotlinx-serialization-runtime-js:$version",
"native" to "org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:$version", "native" to "org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:$version",
dependencySourceSet = sourceSet dependencySourceSet = sourceSet,
dependencyConfiguration = configuration
) )
SerializationTargets(sourceSet, configuration).apply(block) SerializationTargets(sourceSet, configuration).apply(block)
} }