Compare commits
149 Commits
Author | SHA1 | Date | |
---|---|---|---|
4106fe27a9 | |||
b7c0d808b7 | |||
e535fdc6f5 | |||
d0079ba307 | |||
a6755e33f5 | |||
185b5514c3 | |||
1e3018275d | |||
4bfd042f96 | |||
979e819c9a | |||
1b179e0b05 | |||
a78a4f6118 | |||
a26c7f6df0 | |||
99e3e1ea85 | |||
b4fb5c515a | |||
54e862681f | |||
e2a342751d | |||
6de53f5c0a | |||
a46ca7ddb8 | |||
|
26a31ed771 | ||
|
680719ac56 | ||
c9440e7fc9 | |||
0e06801d5f | |||
|
b4b66a101d | ||
8b14d5bed5 | |||
b541fde58a | |||
a27c1953b3 | |||
8a2c0b6e7d | |||
5d3eeaeeee | |||
5dacf9c9d6 | |||
b4f494e58a | |||
8df651bead | |||
c77f74c94b | |||
362d7a4042 | |||
187b8e8076 | |||
aafcb06a1e | |||
5d0324bc7b | |||
f6e27eebdd | |||
1c80eeb2c7 | |||
3565a03d57 | |||
adfd6641cc | |||
a5618726bf | |||
|
7d130dbecb | ||
0f1e42ab36 | |||
be1767f090 | |||
c236320855 | |||
97b0aa9d02 | |||
64b15356e7 | |||
|
2665d208b1 | ||
f283d4d454 | |||
|
39c7ac024f | ||
89bc45cd1c | |||
0ba70aba5c | |||
0bea2d34a5 | |||
af891a2149 | |||
|
53c399d542 | ||
8ba91f805e | |||
19f3d1ba5d | |||
90880fc10f | |||
eed0f274c7 | |||
e3ecfb54c9 | |||
6526a486f9 | |||
07bde0e593 | |||
368ed94c52 | |||
|
277ab651f8 | ||
|
a9b35eb466 | ||
|
3d843210ea | ||
|
6d5a29567d | ||
6e9ef8326b | |||
027a00a486 | |||
96dff3f3ee | |||
|
4891b1f469 | ||
|
b150fd5fd3 | ||
|
e9c6174645 | ||
e1a11452d2 | |||
|
22e6657e79 | ||
|
66564457ff | ||
|
e8a301b4d1 | ||
526faf33eb | |||
|
69676b8521 | ||
|
572cbce67f | ||
|
778e4875d2 | ||
|
25c1c45818 | ||
|
acb13abc6e | ||
|
137299b615 | ||
|
dd5a9f75c4 | ||
|
74b38c62ef | ||
|
63600f9ebb | ||
|
1ee0e7ab41 | ||
7a9cf427f7 | |||
63106cd3aa | |||
dae2dfcde7 | |||
820664a74b | |||
7d16d0f5c7 | |||
|
0ba835925e | ||
|
59c2a13e4b | ||
b5270617fc | |||
5b88c2c5ad | |||
|
d911842922 | ||
e007ac9c7a | |||
|
a915d2256d | ||
54274f0c0d | |||
1c37a165c2 | |||
931d69ec1d | |||
680bd9ed33 | |||
0415ed30d5 | |||
8410e7e498 | |||
138ee1cfea | |||
db9b4dec50 | |||
878405ac6a | |||
6fa4b264a2 | |||
|
f67f1bf4f0 | ||
|
e586d20c91 | ||
dd3d95dba4 | |||
|
2a6c88636b | ||
|
c8edc513f1 | ||
|
02d2971b79 | ||
|
dc2ff2efb3 | ||
|
4f49e24d61 | ||
|
c227258e09 | ||
|
3fa500f451 | ||
|
852158c665 | ||
|
b751e79a8a | ||
|
970b9ad581 | ||
|
bb573291dd | ||
|
4768874bb5 | ||
100f7cd55f | |||
|
252a633583 | ||
|
b70037385c | ||
f11d47aee5 | |||
4eeb81cdbb | |||
2ad0630b7b | |||
|
8fe085c4bd | ||
663f2ea630 | |||
35e01abf93 | |||
|
000bc1e986 | ||
|
19a604f3b3 | ||
670a4ca71e | |||
329bfa5881 | |||
24af07eb7b | |||
5cd86474de | |||
ddbb128692 | |||
357e4c03be | |||
e44bf118dc | |||
e0d331d4d4 | |||
c5b8c688a2 | |||
023ca7b80c | |||
5ff90436f5 | |||
ba4548b3d7 | |||
a221951197 |
21
.github/workflows/build.yml
vendored
Normal file
21
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
name: Gradle build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ dev, master ]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 40
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-java@v2.5.0
|
||||
with:
|
||||
java-version: 11
|
||||
distribution: liberica
|
||||
- uses: gradle/gradle-build-action@v2
|
||||
with:
|
||||
arguments: build
|
24
.github/workflows/publish.yml
vendored
Normal file
24
.github/workflows/publish.yml
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
name: Gradle publish
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
release:
|
||||
types: [ created ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 40
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-java@v2.5.0
|
||||
with:
|
||||
java-version: 11
|
||||
distribution: liberica
|
||||
- uses: gradle/gradle-build-action@v2
|
||||
with:
|
||||
arguments: |
|
||||
publishAllPublicationsToSpaceRepository
|
||||
-Ppublishing.space.user=${{ secrets.SPACE_APP_ID }}
|
||||
-Ppublishing.space.token=${{ secrets.SPACE_APP_SECRET }}
|
43
.space.kts
Normal file
43
.space.kts
Normal file
@ -0,0 +1,43 @@
|
||||
import kotlin.io.path.readText
|
||||
|
||||
job("Build") {
|
||||
gradlew("openjdk:11", "build")
|
||||
}
|
||||
|
||||
job("Publish"){
|
||||
startOn {
|
||||
gitPush { enabled = false }
|
||||
}
|
||||
container("openjdk:11") {
|
||||
env["SPACE_USER"] = Secrets("space_user")
|
||||
env["SPACE_TOKEN"] = Secrets("space_token")
|
||||
kotlinScript { api ->
|
||||
|
||||
val spaceUser = System.getenv("SPACE_USER")
|
||||
val spaceToken = System.getenv("SPACE_TOKEN")
|
||||
|
||||
// write version to the build directory
|
||||
api.gradlew("version")
|
||||
|
||||
//read version from build file
|
||||
val version = java.nio.file.Path.of("build/project-version.txt").readText()
|
||||
|
||||
api.space().projects.automation.deployments.start(
|
||||
project = api.projectIdentifier(),
|
||||
targetIdentifier = TargetIdentifier.Key("gradle-tools"),
|
||||
version = version,
|
||||
// automatically update deployment status based on a status of a job
|
||||
syncWithAutomationJob = true
|
||||
)
|
||||
try {
|
||||
api.gradlew(
|
||||
"publishAllPublicationsToSpaceRepository",
|
||||
"-Ppublishing.space.user=\"$spaceUser\"",
|
||||
"-Ppublishing.space.token=\"$spaceToken\"",
|
||||
)
|
||||
} catch (ex: Exception) {
|
||||
println("Publish failed")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
165
CHANGELOG.md
165
CHANGELOG.md
@ -1,11 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
## Unreleased
|
||||
|
||||
### Added
|
||||
|
||||
### Changed
|
||||
@ -18,7 +18,130 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
### Security
|
||||
|
||||
## [0.9.5]
|
||||
## 0.14.4-kotlin-1.8.20-RC - 2023-03-12
|
||||
|
||||
### Added
|
||||
- Easier dependency handling in `kscience` block
|
||||
- Customizable base jdk version
|
||||
|
||||
### Changed
|
||||
- MPP does not use JVM and JS(IR) targets anymore. They could be turned manually via `js()`, `jvm()` or `fullStack()`
|
||||
- Signing is not applied if signingId is not provided
|
||||
|
||||
### Removed
|
||||
- FX plugins
|
||||
- Unnecessary library shortcuts (html and datetime)
|
||||
- deploy/release tasks
|
||||
|
||||
### Fixed
|
||||
- Gradle 8 compatibility
|
||||
- Dokka publication
|
||||
- issues with test sourcesets
|
||||
|
||||
## 0.13.4-kotlin-1.8.0 - 2022-12-31
|
||||
|
||||
### Added
|
||||
- Public `isInDevelopment` project flag
|
||||
|
||||
### Changed
|
||||
- Require manual pom config for publications
|
||||
- Kotlin 1.8.0
|
||||
- Versions update
|
||||
- Project group changed to `space.kscience`
|
||||
- Moved `yarn.lock` to `gradle` directory
|
||||
|
||||
### Deprecated
|
||||
- FX configuration
|
||||
|
||||
### Removed
|
||||
- Xjdk-release flag because it is broken until https://youtrack.jetbrains.com/issue/KT-52823
|
||||
- Use CSS loader in JS by default
|
||||
|
||||
## 0.11.6-kotlin-1.7.0
|
||||
|
||||
### Changed
|
||||
- Coroutines tests are applied only when explicit `useCoroutines` is used.
|
||||
|
||||
### Removed
|
||||
- Atomicfu support inside the plugin
|
||||
|
||||
### Fixed
|
||||
- Rollback coroutines to 1.6.1
|
||||
|
||||
## 0.11.5-kotlin-1.7.0
|
||||
|
||||
### Added
|
||||
- Coroutine tests as default dependency for tests
|
||||
- Context receiver flag
|
||||
|
||||
### Changed
|
||||
- Separate release tasks for each target
|
||||
- Kotlin 1.7.0
|
||||
- Ktor 2.0.1
|
||||
- ExplicitAPI does not override existing value
|
||||
|
||||
### Removed
|
||||
- Ktor specific artifacts from version catalog
|
||||
|
||||
### Fixed
|
||||
- Moved signing out of sonatype block
|
||||
|
||||
## 0.11.1-kotlin-1.6.10
|
||||
|
||||
### Added
|
||||
- Default templates for README and ARTIFACT
|
||||
|
||||
### Changed
|
||||
- Replaced Groovy templates by FreeMarker
|
||||
|
||||
### Fixed
|
||||
- JS publication sources jar
|
||||
|
||||
## 0.10.9-kotlin-1.6.10
|
||||
|
||||
### Added
|
||||
- html builders for readme
|
||||
|
||||
### Changed
|
||||
- Kotlin 1.6.0
|
||||
- Use indy lambdas by default #32
|
||||
- Change version scheme to `<version>-kotlin-<kotlin version>`
|
||||
|
||||
### Fixed
|
||||
- remove `nativeMain` dependency from `nativeTest`
|
||||
|
||||
## 0.10.4
|
||||
|
||||
### Changed
|
||||
- Kotlin 1.6
|
||||
|
||||
### Fixed
|
||||
- Some issues with opt-ins
|
||||
|
||||
## 0.10.2
|
||||
|
||||
### Added
|
||||
- Experimental automatic JS project bundling in MPP
|
||||
|
||||
### Changed
|
||||
- Remove vcs requirement for Space publication
|
||||
|
||||
## 0.10.0
|
||||
|
||||
### Added
|
||||
- Lazy readme properties
|
||||
- BOM for kotlin-wrappers on JS
|
||||
- Jupyter loader
|
||||
|
||||
### Changed
|
||||
- API validation disabled for dev versions
|
||||
- Kotlin plugins are propagated downstream
|
||||
|
||||
### Removed
|
||||
- bson support
|
||||
|
||||
## 0.9.5
|
||||
|
||||
### Added
|
||||
- Disable API validation for snapshots
|
||||
- `-Xjvm-default=all` on JVM
|
||||
@ -29,17 +152,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- `useDateTime` in extension
|
||||
- Kotlin 1.5
|
||||
|
||||
### Deprecated
|
||||
|
||||
### Removed
|
||||
- Publish plugin. Use MavenPublish instead
|
||||
|
||||
### Fixed
|
||||
- Removed unnecessary `afterEvaluate` for compatibility with gradle 7.0
|
||||
|
||||
### Security
|
||||
## 0.9.0
|
||||
|
||||
## [0.9.0]
|
||||
### Added
|
||||
- Skip sonatype publishing for dev versions
|
||||
|
||||
@ -53,11 +173,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
### Removed
|
||||
- Bintray publishing
|
||||
|
||||
### Fixed
|
||||
## 0.8.4
|
||||
|
||||
### Security
|
||||
|
||||
## [0.8.4]
|
||||
### Added
|
||||
- Adaptive support for host OS in native
|
||||
- CSS support for JS targets
|
||||
@ -66,18 +183,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Kotlin 1.4.31
|
||||
- Coroutines 1.4.3
|
||||
|
||||
### Deprecated
|
||||
|
||||
### Removed
|
||||
|
||||
### Fixed
|
||||
- Plugin loading order for publishing
|
||||
- Release task
|
||||
- Readme generation for multi-module project
|
||||
|
||||
### Security
|
||||
## 0.8.1
|
||||
|
||||
## [0.8.1]
|
||||
### Added
|
||||
- Ktor version to versions
|
||||
- Add sonatype publishing
|
||||
@ -90,8 +202,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Common plugin id changed to `common`
|
||||
- Plugins group changed to `ru.mipt.npm` with `gradle` prefix
|
||||
|
||||
### Deprecated
|
||||
|
||||
### Removed
|
||||
- kaml
|
||||
|
||||
@ -99,9 +209,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Fix publishing load order for sonatype
|
||||
- Fix root project readme
|
||||
|
||||
### Security
|
||||
|
||||
## [0.7.4]
|
||||
## 0.7.4
|
||||
|
||||
### Added
|
||||
- Changelog plugin automatically applied to `project`.
|
||||
@ -128,11 +236,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
### Removed
|
||||
- `useDokka` method. Documentation jar should be added manually if needed.
|
||||
|
||||
|
||||
### Fixed
|
||||
|
||||
### Security
|
||||
## [0.6.0]
|
||||
## 0.6.0
|
||||
|
||||
### Added
|
||||
- Migrate to kotlin 1.4.0
|
||||
@ -140,10 +244,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Add `application()` toggle in plugin configuration to produce binaries on JS and applicaion plugin on jvm.
|
||||
- Add `publish` to expose publishing configuration.
|
||||
|
||||
### Changed
|
||||
-Publishing in bintray now is automatic.
|
||||
|
||||
## [0.5.2]
|
||||
## 0.5.2
|
||||
|
||||
### Added
|
||||
- Copy resources for jvm modules and jvm source sets in mpp.
|
||||
- Copy resources for jvm modules and jvm source sets in mpp.
|
||||
|
29
README.md
29
README.md
@ -1,29 +1,28 @@
|
||||
[![Maven Central](https://img.shields.io/maven-central/v/space.kscience.gradle.project/space.kscience.gradle.project.gradle.plugin.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22space.kscience.gradle.project%22%20AND%20a:%22space.kscience.gradle.project.gradle.plugin%22)
|
||||
|
||||
# KScience build tools
|
||||
|
||||
A collection of gradle plugins for building and publish in *kscience* and *dataforge* projects.
|
||||
|
||||
## ru.mipt.npm.gradle.common
|
||||
## space.kscience.gradle.common
|
||||
A primary plugin. When used with kotlin-jvm, kotlin-js or kotlin-mulitplatform configures the project for appropriate target.
|
||||
|
||||
## ru.mipt.npm.gradle.project
|
||||
## space.kscience.gradle.project
|
||||
Root project tool including JetBrains changelog plugin an kotlin binary compatibility validator tool.
|
||||
|
||||
## ru.mipt.npm.gradle.publish
|
||||
Enables publishing to maven-central, bintray, Space and github.
|
||||
|
||||
## ru.mipt.npm.gradle.mpp
|
||||
`= kotlin("multiplatform") + ru.mipt.npm.gradle.common`
|
||||
## space.kscience.gradle.mpp
|
||||
`= kotlin("multiplatform") + space.kscience.gradle.common`
|
||||
|
||||
Includes JVM-IR and JS-IR-Browser targets.
|
||||
|
||||
## ru.mipt.npm.gradle.jvm
|
||||
`= kotlin("jvm") + ru.mipt.npm.gradle.common`
|
||||
## space.kscience.gradle.jvm
|
||||
`= kotlin("jvm") + space.kscience.gradle.common`
|
||||
|
||||
## ru.mipt.npm.gradle.js
|
||||
`= kotlin("js") + ru.mipt.npm.gradle.common`
|
||||
## space.kscience.gradle.js
|
||||
`= kotlin("js") + space.kscience.gradle.common`
|
||||
|
||||
## ru.mipt.npm.gradle.native
|
||||
add default native targets to `ru.mipt.npm.gradle.mpp`
|
||||
## space.kscience.gradle.native
|
||||
add default native targets to `space.kscience.gradle.mpp`
|
||||
|
||||
## ru.mipt.npm.gradle.node
|
||||
add node target to `ru.mipt.npm.gradle.mpp`
|
||||
## space.kscience.gradle.node
|
||||
add node target to `space.kscience.gradle.mpp`
|
||||
|
315
build.gradle.kts
315
build.gradle.kts
@ -3,18 +3,17 @@ plugins {
|
||||
`kotlin-dsl`
|
||||
`maven-publish`
|
||||
signing
|
||||
id("org.jetbrains.changelog") version "1.1.2"
|
||||
id("org.jetbrains.dokka") version "1.4.32"
|
||||
`version-catalog`
|
||||
alias(libs.plugins.changelog)
|
||||
alias(libs.plugins.dokka)
|
||||
}
|
||||
|
||||
group = "ru.mipt.npm"
|
||||
version = "0.9.5"
|
||||
group = "space.kscience"
|
||||
version = libs.versions.tools.get()
|
||||
|
||||
description = "Build tools for DataForge and kscience projects"
|
||||
description = "Build tools for kotlin for science projects"
|
||||
|
||||
changelog{
|
||||
version = project.version.toString()
|
||||
}
|
||||
changelog.version.set(project.version.toString())
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@ -22,167 +21,209 @@ repositories {
|
||||
maven("https://repo.kotlin.link")
|
||||
}
|
||||
|
||||
val kotlinVersion = "1.5.0"
|
||||
kotlin.explicitApiWarning()
|
||||
|
||||
java {
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
// Add plugins used in buildSrc as dependencies, also we should specify version only here
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
|
||||
implementation("org.jetbrains.kotlin:kotlin-serialization:$kotlinVersion")
|
||||
implementation("org.jetbrains.kotlinx:atomicfu-gradle-plugin:0.16.1")
|
||||
implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.4.32")
|
||||
implementation("org.jetbrains.intellij.plugins:gradle-changelog-plugin:1.1.2")
|
||||
implementation("org.jetbrains.kotlinx:binary-compatibility-validator:0.5.0")
|
||||
api(libs.kotlin.gradle)
|
||||
implementation(libs.binary.compatibility.validator)
|
||||
implementation(libs.changelog.gradle)
|
||||
implementation(libs.dokka.gradle)
|
||||
implementation(libs.kotlin.jupyter.gradle)
|
||||
implementation(libs.kotlin.serialization)
|
||||
implementation(libs.kotlinx.html)
|
||||
implementation("org.tomlj:tomlj:1.1.0")
|
||||
// // nexus publishing plugin
|
||||
// implementation("io.github.gradle-nexus:publish-plugin:1.1.0")
|
||||
|
||||
implementation("org.freemarker:freemarker:2.3.31")
|
||||
|
||||
testImplementation(kotlin("test"))
|
||||
}
|
||||
|
||||
project.extensions.findByType<GradlePluginDevelopmentExtension>()?.apply {
|
||||
plugins {
|
||||
create("common") {
|
||||
id = "ru.mipt.npm.gradle.common"
|
||||
description = "The generalized kscience plugin that works in conjunction with any kotlin plugin"
|
||||
implementationClass = "ru.mipt.npm.gradle.KScienceCommonPlugin"
|
||||
}
|
||||
tasks.test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
//declaring exported plugins
|
||||
|
||||
gradlePlugin {
|
||||
plugins {
|
||||
create("project") {
|
||||
id = "ru.mipt.npm.gradle.project"
|
||||
description = "The root plugin for multimodule project infrastructure"
|
||||
implementationClass = "ru.mipt.npm.gradle.KScienceProjectPlugin"
|
||||
id = "space.kscience.gradle.project"
|
||||
description = "The root plugin for multi-module project infrastructure"
|
||||
implementationClass = "space.kscience.gradle.KScienceProjectPlugin"
|
||||
}
|
||||
|
||||
create("mpp") {
|
||||
id = "ru.mipt.npm.gradle.mpp"
|
||||
id = "space.kscience.gradle.mpp"
|
||||
description = "Pre-configured multiplatform project"
|
||||
implementationClass = "ru.mipt.npm.gradle.KScienceMPPlugin"
|
||||
implementationClass = "space.kscience.gradle.KScienceMPPlugin"
|
||||
}
|
||||
|
||||
create("jvm") {
|
||||
id = "ru.mipt.npm.gradle.jvm"
|
||||
id = "space.kscience.gradle.jvm"
|
||||
description = "Pre-configured JVM project"
|
||||
implementationClass = "ru.mipt.npm.gradle.KScienceJVMPlugin"
|
||||
implementationClass = "space.kscience.gradle.KScienceJVMPlugin"
|
||||
}
|
||||
|
||||
create("js") {
|
||||
id = "ru.mipt.npm.gradle.js"
|
||||
id = "space.kscience.gradle.js"
|
||||
description = "Pre-configured JS project"
|
||||
implementationClass = "ru.mipt.npm.gradle.KScienceJSPlugin"
|
||||
}
|
||||
|
||||
create("native") {
|
||||
id = "ru.mipt.npm.gradle.native"
|
||||
description = "Additional native targets to be use alongside mpp"
|
||||
implementationClass = "ru.mipt.npm.gradle.KScienceNativePlugin"
|
||||
}
|
||||
|
||||
create("node") {
|
||||
id = "ru.mipt.npm.gradle.node"
|
||||
description = "Additional nodejs target to be use alongside mpp"
|
||||
implementationClass = "ru.mipt.npm.gradle.KScienceNodePlugin"
|
||||
implementationClass = "space.kscience.gradle.KScienceJSPlugin"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
publishing {
|
||||
val vcs = "https://github.com/mipt-npm/gradle-tools"
|
||||
tasks.create("version") {
|
||||
group = "publishing"
|
||||
val versionFile = project.buildDir.resolve("project-version.txt")
|
||||
outputs.file(versionFile)
|
||||
doLast {
|
||||
versionFile.createNewFile()
|
||||
versionFile.writeText(project.version.toString())
|
||||
println(project.version)
|
||||
}
|
||||
}
|
||||
|
||||
val sourcesJar: Jar by tasks.creating(Jar::class) {
|
||||
archiveClassifier.set("sources")
|
||||
from(sourceSets.named("main").get().allSource)
|
||||
//publishing version catalog
|
||||
|
||||
catalog.versionCatalog {
|
||||
from(files("gradle/libs.versions.toml"))
|
||||
}
|
||||
|
||||
//publishing the artifact
|
||||
|
||||
val sourcesJar by tasks.creating(Jar::class) {
|
||||
archiveClassifier.set("sources")
|
||||
from(sourceSets.named("main").get().allSource)
|
||||
}
|
||||
|
||||
val javadocsJar by tasks.creating(Jar::class) {
|
||||
group = JavaBasePlugin.DOCUMENTATION_GROUP
|
||||
archiveClassifier.set("javadoc")
|
||||
from(tasks.dokkaHtml)
|
||||
}
|
||||
|
||||
val emptyJavadocJar by tasks.creating(Jar::class) {
|
||||
group = JavaBasePlugin.DOCUMENTATION_GROUP
|
||||
archiveBaseName.set("empty")
|
||||
archiveClassifier.set("javadoc")
|
||||
}
|
||||
|
||||
|
||||
val emptySourcesJar by tasks.creating(Jar::class) {
|
||||
archiveClassifier.set("sources")
|
||||
archiveBaseName.set("empty")
|
||||
}
|
||||
|
||||
publishing {
|
||||
val vcs = "https://github.com/mipt-npm/gradle-tools"
|
||||
|
||||
// Process each publication we have in this project
|
||||
publications {
|
||||
create<MavenPublication>("catalog") {
|
||||
from(components["versionCatalog"])
|
||||
artifactId = "version-catalog"
|
||||
|
||||
pom {
|
||||
name.set("version-catalog")
|
||||
}
|
||||
}
|
||||
|
||||
val javadocsJar: Jar by tasks.creating(Jar::class) {
|
||||
group = "documentation"
|
||||
archiveClassifier.set("javadoc")
|
||||
from(tasks.dokkaHtml)
|
||||
}
|
||||
withType<MavenPublication> {
|
||||
// thanks @vladimirsitnikv for the fix
|
||||
artifact(if (name == "catalog") emptySourcesJar else sourcesJar)
|
||||
artifact(if (name == "catalog") emptyJavadocJar else javadocsJar)
|
||||
|
||||
// Process each publication we have in this project
|
||||
publications.filterIsInstance<MavenPublication>().forEach { publication ->
|
||||
publication.apply {
|
||||
artifact(sourcesJar)
|
||||
artifact(javadocsJar)
|
||||
|
||||
pom {
|
||||
name.set(project.name)
|
||||
description.set(project.description)
|
||||
pom {
|
||||
name.set(project.name)
|
||||
description.set(project.description)
|
||||
url.set(vcs)
|
||||
|
||||
licenses {
|
||||
license {
|
||||
name.set("The Apache Software License, Version 2.0")
|
||||
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
|
||||
distribution.set("repo")
|
||||
}
|
||||
}
|
||||
|
||||
developers {
|
||||
developer {
|
||||
id.set("MIPT-NPM")
|
||||
name.set("MIPT nuclear physics methods laboratory")
|
||||
organization.set("MIPT")
|
||||
organizationUrl.set("https://npm.mipt.ru")
|
||||
}
|
||||
}
|
||||
|
||||
scm {
|
||||
url.set(vcs)
|
||||
|
||||
licenses {
|
||||
license {
|
||||
name.set("The Apache Software License, Version 2.0")
|
||||
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
|
||||
distribution.set("repo")
|
||||
}
|
||||
}
|
||||
developers {
|
||||
developer {
|
||||
id.set("MIPT-NPM")
|
||||
name.set("MIPT nuclear physics methods laboratory")
|
||||
organization.set("MIPT")
|
||||
organizationUrl.set("http://npm.mipt.ru")
|
||||
}
|
||||
|
||||
}
|
||||
scm {
|
||||
url.set(vcs)
|
||||
tag.set(project.version.toString())
|
||||
}
|
||||
tag.set(project.version.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val spaceRepo: String = "https://maven.pkg.jetbrains.space/mipt-npm/p/mipt-npm/maven"
|
||||
val spaceUser: String? = project.findProperty("publishing.space.user") as? String
|
||||
val spaceToken: String? = project.findProperty("publishing.space.token") as? String
|
||||
|
||||
if (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 sonatypeUser: String? = project.findProperty("publishing.sonatype.user") as? String
|
||||
val sonatypePassword: String? = project.findProperty("publishing.sonatype.password") as? String
|
||||
|
||||
if (sonatypeUser != null && sonatypePassword != null) {
|
||||
val sonatypeRepo: String = if (project.version.toString().contains("dev")) {
|
||||
"https://oss.sonatype.org/content/repositories/snapshots"
|
||||
} else {
|
||||
"https://oss.sonatype.org/service/local/staging/deploy/maven2"
|
||||
}
|
||||
|
||||
if (plugins.findPlugin("signing") == null) {
|
||||
plugins.apply("signing")
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = "sonatype"
|
||||
url = uri(sonatypeRepo)
|
||||
credentials {
|
||||
username = sonatypeUser
|
||||
password = sonatypePassword
|
||||
}
|
||||
}
|
||||
}
|
||||
signing {
|
||||
//useGpgCmd()
|
||||
sign(publications)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val spaceRepo = "https://maven.pkg.jetbrains.space/spc/p/sci/maven"
|
||||
val spaceUser: String? = findProperty("publishing.space.user") as? String
|
||||
val spaceToken: String? = findProperty("publishing.space.token") as? String
|
||||
|
||||
if (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 sonatypeUser: String? = project.findProperty("publishing.sonatype.user") as? String
|
||||
val sonatypePassword: String? = project.findProperty("publishing.sonatype.password") as? String
|
||||
|
||||
if (sonatypeUser != null && sonatypePassword != null) {
|
||||
val sonatypeRepo: String = if (project.version.toString().contains("dev")) {
|
||||
"https://oss.sonatype.org/content/repositories/snapshots"
|
||||
} else {
|
||||
"https://oss.sonatype.org/service/local/staging/deploy/maven2"
|
||||
}
|
||||
|
||||
repositories.maven {
|
||||
name = "sonatype"
|
||||
url = uri(sonatypeRepo)
|
||||
|
||||
credentials {
|
||||
username = sonatypeUser
|
||||
password = sonatypePassword
|
||||
}
|
||||
}
|
||||
|
||||
signing {
|
||||
//useGpgCmd()
|
||||
sign(publications)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
kotlin {
|
||||
jvmToolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(11))
|
||||
}
|
||||
}
|
||||
|
||||
tasks.processResources.configure {
|
||||
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
||||
from("gradle/libs.versions.toml")
|
||||
}
|
||||
|
||||
// Workaround for https://github.com/gradle/gradle/issues/15568
|
||||
tasks.withType<AbstractPublishToMaven>().configureEach {
|
||||
mustRunAfter(tasks.withType<Sign>())
|
||||
}
|
1
gradle.properties
Normal file
1
gradle.properties
Normal file
@ -0,0 +1 @@
|
||||
kotlin.code.style=official
|
116
gradle/libs.versions.toml
Normal file
116
gradle/libs.versions.toml
Normal file
@ -0,0 +1,116 @@
|
||||
[versions]
|
||||
tools = "0.14.4-kotlin-1.8.20-RC"
|
||||
kotlin = "1.8.20-RC"
|
||||
atomicfu = "0.19.0"
|
||||
binary-compatibility-validator = "0.12.1"
|
||||
changelog = "2.0.0"
|
||||
dokka = "1.7.20"
|
||||
kotlin-jupyter = "0.11.0-317"
|
||||
kotlinx-benchmark = "0.4.7"
|
||||
kotlinx-cli = "0.3.5"
|
||||
kotlinx-coroutines = "1.6.4"
|
||||
kotlinx-datetime = "0.4.0"
|
||||
kotlinx-html = "0.8.0"
|
||||
kotlinx-knit = "0.4.0"
|
||||
kotlinx-nodejs = "0.0.7"
|
||||
kotlinx-serialization = "1.4.1"
|
||||
ktor = "2.2.3"
|
||||
xmlutil = "0.84.3"
|
||||
yamlkt = "0.12.0"
|
||||
jsBom = "1.0.0-pre.509"
|
||||
junit = "5.9.2"
|
||||
compose = "1.3.0"
|
||||
logback = "1.4.5"
|
||||
|
||||
[libraries]
|
||||
atomicfu-gradle = { module = "org.jetbrains.kotlinx:atomicfu-gradle-plugin", version.ref = "atomicfu" }
|
||||
atomicfu = { module = "org.jetbrains.kotlinx:atomicfu", version.ref = "atomicfu" }
|
||||
|
||||
binary-compatibility-validator = { module = "org.jetbrains.kotlinx:binary-compatibility-validator", version.ref = "binary-compatibility-validator" }
|
||||
|
||||
changelog-gradle = { module = "org.jetbrains.intellij.plugins:gradle-changelog-plugin", version.ref = "changelog" }
|
||||
|
||||
dokka-gradle = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" }
|
||||
|
||||
kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
|
||||
kotlin-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" }
|
||||
|
||||
kotlin-jupyter-gradle = { module = "org.jetbrains.kotlin:kotlin-jupyter-api-gradle-plugin", version.ref = "kotlin-jupyter" }
|
||||
|
||||
kotlinx-benchmark-runtime = { module = "org.jetbrains.kotlinx:kotlinx-benchmark-runtime", version.ref = "kotlinx-benchmark" }
|
||||
|
||||
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
|
||||
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinx-coroutines" }
|
||||
kotlinx-coroutines-debug = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-debug", version.ref = "kotlinx-coroutines" }
|
||||
kotlinx-coroutines-reactive = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-reactive", version.ref = "kotlinx-coroutines" }
|
||||
kotlinx-coroutines-reactor = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-reactor", version.ref = "kotlinx-coroutines" }
|
||||
kotlinx-coroutines-rx2 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-rx2", version.ref = "kotlinx-coroutines" }
|
||||
kotlinx-coroutines-rx3 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-rx3", version.ref = "kotlinx-coroutines" }
|
||||
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" }
|
||||
kotlinx-coroutines-javafx = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-javafx", version.ref = "kotlinx-coroutines" }
|
||||
kotlinx-coroutines-swing = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-swing", version.ref = "kotlinx-coroutines" }
|
||||
kotlinx-coroutines-jdk8 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8", version.ref = "kotlinx-coroutines" }
|
||||
kotlinx-coroutines-guava = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-guava", version.ref = "kotlinx-coroutines" }
|
||||
kotlinx-coroutines-slf4j = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-slf4j", version.ref = "kotlinx-coroutines" }
|
||||
kotlinx-coroutines-play-services = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-play-services", version.ref = "kotlinx-coroutines" }
|
||||
|
||||
kotlinx-cli = { module = "org.jetbrains.kotlinx:kotlinx-cli", version.ref = "kotlinx-cli" }
|
||||
|
||||
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinx-datetime" }
|
||||
|
||||
kotlinx-html = { module = "org.jetbrains.kotlinx:kotlinx-html", version.ref = "kotlinx-html" }
|
||||
|
||||
kotlinx-knit = { module = "org.jetbrains.kotlinx:kotlinx-knit", version.ref = "kotlinx-knit" }
|
||||
|
||||
kotlinx-nodejs = { module = "org.jetbrains.kotlinx:kotlinx-nodejs", version.ref = "kotlinx-nodejs" }
|
||||
|
||||
kotlinx-serialization-cbor = { module = "org.jetbrains.kotlinx:kotlinx-serialization-cbor", version.ref = "kotlinx-serialization" }
|
||||
kotlinx-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "kotlinx-serialization" }
|
||||
kotlinx-serialization-hocon = { module = "org.jetbrains.kotlinx:kotlinx-serialization-hocon", version.ref = "kotlinx-serialization" }
|
||||
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" }
|
||||
kotlinx-serialization-protobuf = { module = "org.jetbrains.kotlinx:kotlinx-serialization-protobuf", version.ref = "kotlinx-serialization" }
|
||||
kotlinx-serialization-properties = { module = "org.jetbrains.kotlinx:kotlinx-serialization-properties", version.ref = "kotlinx-serialization" }
|
||||
|
||||
ktor-bom = { module = "io.ktor:ktor-bom", version.ref = "ktor" }
|
||||
|
||||
xmlutil-core = { module = "io.github.pdvrieze.xmlutil:core", version.ref = "xmlutil" }
|
||||
xmlutil-ktor = { module = "io.github.pdvrieze.xmlutil:ktor", version.ref = "xmlutil" }
|
||||
xmlutil-serialization = { module = "io.github.pdvrieze.xmlutil:serialization", version.ref = "xmlutil" }
|
||||
|
||||
yamlkt = { module = "net.mamoe.yamlkt:yamlkt", version.ref = "yamlkt" }
|
||||
|
||||
logback-classic = {module = "ch.qos.logback:logback-classic", version.ref = "logback"}
|
||||
|
||||
[plugins]
|
||||
changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" }
|
||||
|
||||
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
|
||||
compose = {id = "org.jetbrains.compose", version.ref = "compose"}
|
||||
|
||||
gradle-common = { id = "space.kscience.gradle.common", version.ref = "tools" }
|
||||
gradle-project = { id = "space.kscience.gradle.project", version.ref = "tools" }
|
||||
gradle-mpp = { id = "space.kscience.gradle.mpp", version.ref = "tools" }
|
||||
gradle-jvm = { id = "space.kscience.gradle.jvm", version.ref = "tools" }
|
||||
gradle-js = { id = "space.kscience.gradle.js", version.ref = "tools" }
|
||||
gradle-native = { id = "space.kscience.gradle.native", version.ref = "tools" }
|
||||
gradle-node = { id = "space.kscience.gradle.node", version.ref = "tools" }
|
||||
|
||||
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
|
||||