Skip to content

Commit

Permalink
Revert "Chore(infra): Prepare atomicfu for including to the Kotlin Ag…
Browse files Browse the repository at this point in the history
…gregate build //KTI-1016 (#265)"

This reverts commit a1aba90
  • Loading branch information
woainikk committed Dec 21, 2022
1 parent a26be29 commit 47e3367
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 93 deletions.
4 changes: 2 additions & 2 deletions atomicfu-gradle-plugin/build.gradle
Expand Up @@ -14,8 +14,8 @@ if (rootProject.ext.jvm_ir_enabled) {
// Gradle plugin must be compiled targeting the same Kotlin version as used by Gradle
kotlin.sourceSets.all {
languageSettings {
apiVersion = KotlinAggregateBuild.getOverriddenKotlinApiVersion(project) ?: "1.7"
languageVersion = KotlinAggregateBuild.getOverriddenKotlinLanguageVersion(project) ?: "1.7"
apiVersion = "1.4"
languageVersion = "1.4"
}
}

Expand Down
21 changes: 9 additions & 12 deletions atomicfu-maven-plugin/build.gradle
Expand Up @@ -23,8 +23,6 @@ def buildSnapshots = rootProject.properties['build_snapshot_train'] != null

evaluationDependsOn(':atomicfu-transformer')

def kotlinDevRepoUrl = KotlinAggregateBuild.getKotlinDevRepositoryUrl(project)

task generatePomFile(dependsOn: [compileKotlin, ':atomicfu-transformer:publishToMavenLocal']) {
def buildDir = project.buildDir // because Maven model also has "project"
outputs.file(pomFile)
Expand All @@ -45,12 +43,11 @@ task generatePomFile(dependsOn: [compileKotlin, ':atomicfu-transformer:publishTo
appendNode('project.build.sourceEncoding', 'UTF-8')
}
appendNode('repositories').with {
if (kotlinDevRepoUrl != null && !kotlinDevRepoUrl.isEmpty()) {
appendNode('repository').with {
appendNode('id', 'dev')
appendNode('url', kotlinDevRepoUrl)
}
appendNode('repository').with {
appendNode('id', 'dev')
appendNode('url', 'https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev')
}

if (buildSnapshots) {
appendNode('repository').with {
appendNode('id', 'kotlin-snapshots')
Expand Down Expand Up @@ -80,11 +77,11 @@ task generatePluginDescriptor(type: Exec, dependsOn: generatePomFile) {
if (mavenUserHome != null) args.add("-Dmaven.user.home=${new File(mavenUserHome).getAbsolutePath()}")
if (mavenRepoLocal != null) args.add("-Dmaven.repo.local=${new File(mavenRepoLocal).getAbsolutePath()}")
args.addAll([
'--settings', './settings.xml',
'--errors',
'--batch-mode',
'--file', pomFile.toString(),
'org.apache.maven.plugins:maven-plugin-plugin:3.5.1:descriptor'
'--settings', './settings.xml',
'--errors',
'--batch-mode',
'--file', pomFile.toString(),
'org.apache.maven.plugins:maven-plugin-plugin:3.5.1:descriptor'
])
commandLine args
doLast {
Expand Down
18 changes: 9 additions & 9 deletions build.gradle
Expand Up @@ -5,8 +5,6 @@
import org.jetbrains.kotlin.konan.target.HostManager

buildscript {


/*
* These property group is used to build kotlinx.atomicfu against Kotlin compiler snapshot.
* How does it work:
Expand All @@ -31,13 +29,14 @@ buildscript {
ext.jvm_ir_enabled = rootProject.properties['enable_jvm_ir'] != null
ext.native_targets_enabled = rootProject.properties['disable_native_targets'] == null


repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
KotlinAggregateBuild.addDevRepositoryIfEnabled(delegate, project)
// Future replacement for kotlin-dev, with cache redirector
maven { url "https://cache-redirector.jetbrains.com/maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" }
maven { url "https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" }
}

dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.moowork.gradle:gradle-node-plugin:$gradle_node_version"
Expand All @@ -55,11 +54,12 @@ allprojects {
}
}

logger.info("Using Kotlin compiler $kotlin_version for $it")

println "Using Kotlin $kotlin_version for project $it"
repositories {
mavenCentral()
KotlinAggregateBuild.addDevRepositoryIfEnabled(delegate, project)
// Future replacement for kotlin-dev, with cache redirector
maven { url "https://cache-redirector.jetbrains.com/maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" }
maven { url "https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" }
}

def deployVersion = properties['DeployVersion']
Expand All @@ -79,7 +79,7 @@ allprojects {
}
}

logger.info("Using Kotlin compiler version: $org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION")
println("Using Kotlin compiler version: $org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION")
if (build_snapshot_train) {
afterEvaluate {
println "Manifest of kotlin-compiler-embeddable.jar for atomicfu"
Expand Down
67 changes: 0 additions & 67 deletions buildSrc/src/main/kotlin/KotlinAggregateBuild.kt

This file was deleted.

2 changes: 2 additions & 0 deletions buildSrc/src/main/kotlin/Publishing.kt
Expand Up @@ -45,10 +45,12 @@ fun MavenPom.configureMavenCentralMetadata(project: Project) {
}

fun mavenRepositoryUri(): URI {
// TODO -SNAPSHOT detection can be made here as well
val repositoryId: String? = System.getenv("libs.repository.id")
return if (repositoryId == null) {
// Using implicitly created staging, for MPP it's likely to be a mistake because
// publication on TeamCity will create 3 independent staging repositories
System.err.println("Warning: using an implicitly created staging for atomicfu")
URI("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
} else {
URI("https://oss.sonatype.org/service/local/staging/deployByRepositoryId/$repositoryId")
Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Expand Up @@ -6,7 +6,6 @@ version=0.18.5-SNAPSHOT
group=org.jetbrains.kotlinx

kotlin_version=1.7.20

asm_version=9.3
slf4j_version=1.8.0-alpha2
junit_version=4.12
Expand Down
4 changes: 2 additions & 2 deletions gradle/compile-options.gradle
Expand Up @@ -19,8 +19,8 @@ ext.configureKotlin = { isMultiplatform ->

kotlin.sourceSets.all {
languageSettings {
apiVersion = KotlinAggregateBuild.getOverriddenKotlinApiVersion(project) ?: "1.7"
languageVersion = KotlinAggregateBuild.getOverriddenKotlinLanguageVersion(project) ?: "1.7"
apiVersion = "1.4"
languageVersion = "1.4"
}
}
}

0 comments on commit 47e3367

Please sign in to comment.