Skip to content

Commit

Permalink
Move the multiplatform project to the root
Browse files Browse the repository at this point in the history
  • Loading branch information
serjsysoev committed Sep 4, 2024
1 parent 7bc931a commit bc94c2f
Show file tree
Hide file tree
Showing 78 changed files with 99 additions and 113 deletions.
106 changes: 0 additions & 106 deletions build.gradle

This file was deleted.

102 changes: 98 additions & 4 deletions multiplatform-annotations/build.gradle.kts → build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,56 @@
import jetbrains.sign.GpgSignSignatoryProvider
import org.gradle.jvm.tasks.Jar
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

/*
* Copyright 2000-2021 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

buildscript {
repositories {
maven { url = uri("https://packages.jetbrains.team/maven/p/jcs/maven") }
}
dependencies {
classpath("com.jetbrains:jet-sign:38")
}
}

repositories {
mavenCentral()
}

plugins {
kotlin("multiplatform") version "1.9.22"
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
`maven-publish`
signing
}

var projectVersion = project.findProperty("projectVersion") as String
val publishingUser: String? = System.getenv("PUBLISHING_USER")
val publishingPassword: String? = System.getenv("PUBLISHING_PASSWORD")
if (publishingPassword == null) {
projectVersion += "-SNAPSHOT"
}
println("##teamcity[setParameter name='java.annotations.version' value='$projectVersion']")

// https://github.com/gradle/gradle/issues/847
group = "org.jetbrains.proto"
version = projectVersion

kotlin {
androidNativeArm32()
androidNativeArm64()
Expand Down Expand Up @@ -62,12 +107,14 @@ kotlin {
}
}

val nonJvmMain by creating {}
val nonJvmMain by creating {
dependsOn(commonMain)
}
}

targets.onEach {
if (it.platformType != KotlinPlatformType.jvm) {
it.compilations.getByName("main").source(sourceSets.getByName("nonJvmMain"))
if (it.platformType != KotlinPlatformType.jvm && it.platformType != KotlinPlatformType.common) {
it.compilations.getByName("main").defaultSourceSet.dependsOn(sourceSets.getByName("nonJvmMain"))
}
}

Expand Down Expand Up @@ -133,4 +180,51 @@ tasks {
into("META-INF/versions/9/")
}
}
}
}

nexusPublishing {
repositories {
sonatype {
username.set(publishingUser)
password.set(publishingPassword)
}
}
}

publishing {
publications.withType(MavenPublication::class) {
group = "org.jetbrains"
version = rootProject.version as String

pom {
name.set("JetBrains Java Annotations")
description.set("A set of annotations used for code inspection support and code documentation.")
url.set("https://github.com/JetBrains/java-annotations")
scm {
url.set("https://github.com/JetBrains/java-annotations")
connection.set("scm:git:git://github.com/JetBrains/java-annotations.git")
developerConnection.set("scm:git:ssh://github.com:JetBrains/java-annotations.git")
}
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("JetBrains")
name.set("JetBrains Team")
organization.set("JetBrains")
organizationUrl.set("https://www.jetbrains.com")
}
}
}
}
}

signing {
sign(publishing.publications)
signatories = GpgSignSignatoryProvider()
}
4 changes: 1 addition & 3 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@
* limitations under the License.
*/

rootProject.name = 'annotations-parent'

include 'multiplatform-annotations'
rootProject.name = 'annotations'
File renamed without changes.

0 comments on commit bc94c2f

Please sign in to comment.