Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multiplatform artifact #103

Merged
merged 6 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Changelog

Version 25.0.0
---
* Added Kotlin Multiplatform artifact (multiplatform-annotations).
* Removed Java 5 artifact.

Version 24.1.0
Expand Down
8 changes: 7 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ During the new version release:
* Push changes
* Use 'Draft a new release' button on the Releases GitHub page; select the added tag; copy it to the release title
field; copy the added changelog section into the release details field.


### Multiplatform artifact
We publish two artifacts: annotations (annotations written in Java) and multiplatform-annotations (same annotations
written in Kotlin Multiplatform). Please check that changes are done both in java-annotations and
multiplatform-annotations folders. Jvm artifact of multiplatform-annotations should be a drop-in replacement of
java-annotations, every annotation added to java-annotations should also be added to multiplatform-annotations.

### Backward compatibility
All the changes should be backward compatible i.e. you can only add new annotations and new elements into existing annotation.
If it's absolutely necessary to remove an annotation or its element we must firstly release a new major version where
Expand Down
105 changes: 33 additions & 72 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,13 @@ if (ext.publishingPassword == null) {
println "##teamcity[setParameter name='java.annotations.version' value='$projectVersion']"

allprojects {
group 'org.jetbrains'
// https://github.com/gradle/gradle/issues/847
group 'org.jetbrains.proto'
version rootProject.ext.projectVersion

repositories {
mavenCentral()
}
}

nexusPublishing {
Expand All @@ -55,85 +60,41 @@ subprojects {
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'signing'

repositories {
mavenCentral()
}
}

project(':java-annotations').archivesBaseName = 'annotations'

configure([project(':java-annotations')]) {
task mainJar(type: Jar) {
into ("META-INF/versions/9", {
from (project(':module-info').sourceSets.main.output, {
// Skip extra files from common sources compiled with Java 9 target
include("module-info.class")
})
})
manifest.attributes("Multi-Release": true)
duplicatesStrategy = DuplicatesStrategy.FAIL
}

task sourceJar(type: Jar) {
into ("META-INF/versions/9", {
from project(':module-info').sourceSets.main.java
})
duplicatesStrategy = DuplicatesStrategy.FAIL
baseName = archivesBaseName + '-sources'
}

task javadocJar(type: Jar) {
duplicatesStrategy = DuplicatesStrategy.FAIL
from javadoc
}

artifacts {
archives mainJar, sourceJar
}

configure([project(':java-annotations'), project(':multiplatform-annotations')]) {
publishing {
publications {
mavenJava(MavenPublication) {
group rootProject.group
version rootProject.ext.projectVersion
artifactId archivesBaseName
artifact mainJar
artifact sourceJar {
classifier 'sources'
}
artifact javadocJar {
classifier 'javadoc'
}
pom.withXml {
asNode().children().last() + {
resolveStrategy = DELEGATE_FIRST
name 'JetBrains Java Annotations'
description 'A set of annotations used for code inspection support and code documentation.'
publications.withType(MavenPublication) {
group 'org.jetbrains'
version rootProject.ext.projectVersion

pom.withXml {
asNode().children().last() + {
resolveStrategy = DELEGATE_FIRST
name 'JetBrains Java Annotations'
description 'A set of annotations used for code inspection support and code documentation.'
url 'https://github.com/JetBrains/java-annotations'
scm {
url 'https://github.com/JetBrains/java-annotations'
scm {
url 'https://github.com/JetBrains/java-annotations'
connection 'scm:git:git://github.com/JetBrains/java-annotations.git'
developerConnection 'scm:git:ssh://github.com:JetBrains/java-annotations.git'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'https://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
connection 'scm:git:git://github.com/JetBrains/java-annotations.git'
developerConnection 'scm:git:ssh://github.com:JetBrains/java-annotations.git'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'https://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
developers {
developer {
id 'JetBrains'
name 'JetBrains Team'
organization 'JetBrains'
organizationUrl 'https://www.jetbrains.com'
}
}
developers {
developer {
id 'JetBrains'
name 'JetBrains Team'
organization 'JetBrains'
organizationUrl 'https://www.jetbrains.com'
}
}
}

}
}
}
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@
#

projectVersion=25.0.0
kotlin.code.style=official
kotlin.mpp.stability.nowarn=true
kotlin.stdlib.default.dependency=false
44 changes: 42 additions & 2 deletions java-annotations/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,55 @@
*/

sourceCompatibility = 1.8
project.archivesBaseName = 'annotations'

mainJar {
task mainJar(type: Jar) {
into ("META-INF/versions/9", {
from (project(':java-module-info').sourceSets.main.output, {
// Skip extra files from common sources compiled with Java 9 target
include("module-info.class")
})
})
manifest.attributes("Multi-Release": true)
from sourceSets.main.output
duplicatesStrategy = DuplicatesStrategy.FAIL
}

sourceJar {
task sourceJar(type: Jar) {
into ("META-INF/versions/9", {
from project(':java-module-info').sourceSets.main.java
})
duplicatesStrategy = DuplicatesStrategy.FAIL
from sourceSets.main.java
baseName = archivesBaseName + '-sources'
}

task javadocJar(type: Jar) {
duplicatesStrategy = DuplicatesStrategy.FAIL
from javadoc
}

javadoc {
source = [sourceSets.main.java]
}

artifacts {
archives mainJar, sourceJar
}

model {
publishing {
publications {
pluginMaven(MavenPublication) {
artifactId archivesBaseName
artifact mainJar
artifact sourceJar {
classifier 'sources'
}
artifact javadocJar {
classifier 'javadoc'
}
}
}
}
}
File renamed without changes.
Loading