Skip to content

Commit

Permalink
0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
andreypfau committed Feb 9, 2025
1 parent f52e969 commit 307e3f5
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 123 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@

### Core components

* `org.ton:ton-kotlin-tvm:0.3.1` - TVM Primitives (Cells, BOC, etc.)
* `org.ton:ton-kotlin-crypto:0.3.1` - Crypto primitives for TON (ED25519, SHA, etc.)
* `org.ton:ton-kotlin-adnl:0.3.1` - ADNL (Abstract Datagram Network Layer) TON Network implementation
* `org.ton.kotlin:ton-kotlin-tvm:0.4.0` - TVM Primitives (Cells, BOC, etc.)
* `org.ton.kotlin:ton-kotlin-crypto:0.4.0` - Crypto primitives for TON (ED25519, SHA, etc.)
* `org.ton.kotlin:ton-kotlin-adnl:0.4.0` - ADNL (Abstract Datagram Network Layer) TON Network implementation

### API Interfaces

* `org.ton:ton-kotlin-contract:0.3.1` - Smart-contracts API interface
* `org.ton:ton-kotlin-liteclient:0.3.1` - Lite-client API implementation
* `org.ton.kotlin:ton-kotlin-contract:0.4.0` - Smart-contracts API interface
* `org.ton.kotlin:ton-kotlin-liteclient:0.4.0` - Lite-client API implementation

### TL-B (TL-Binary)

* `org.ton:ton-kotlin-tlb:0.3.1` - TON TL-B (TL-Binary) serialization/deserialization
* `org.ton:ton-kotlin-block-tlb:0.3.1` - Pre-generated TL-B schemas for TON Blockchain
* `org.ton:ton-kotlin-hashmap-tlb:0.3.1` - Pre-generated TL-B schemas for TON Hashmap (also known as Dictionary)
* `org.ton.kotlin:ton-kotlin-tlb:0.4.0` - TON TL-B (TL-Binary) serialization/deserialization
* `org.ton.kotlin:ton-kotlin-block-tlb:0.4.0` - Pre-generated TL-B schemas for TON Blockchain
* `org.ton.kotlin:ton-kotlin-hashmap-tlb:0.4.0` - Pre-generated TL-B schemas for TON Hashmap (also known as Dictionary)

## Documentation

https://github.com/andreypfau/ton-kotlin/wiki/TON-Kotlin-documentation

<!-- Badges -->

[maven-central]: https://central.sonatype.com/artifact/org.ton/ton-kotlin-tvm/0.3.1
[maven-central]: https://central.sonatype.com/artifact/org.ton/ton-kotlin-tvm/0.4.0

[license]: LICENSE

Expand Down
2 changes: 1 addition & 1 deletion build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ repositories {

dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20")
// implementation("io.github.gradle-nexus:publish-plugin:2.0.0-rc-1")
implementation("com.vanniktech:gradle-maven-publish-plugin:0.28.0")
}
127 changes: 27 additions & 100 deletions build-logic/src/main/kotlin/publish.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,109 +1,36 @@
import org.gradle.jvm.tasks.Jar
import java.net.URI
import com.vanniktech.maven.publish.SonatypeHost

plugins {
`maven-publish`
signing
}

publishing {
val javadocJar = project.configureEmptyJavadocArtifact()
publications.withType(MavenPublication::class).all {
pom.configureMavenCentralMetadata(project)
signPublicationIfKeyPresent(project, this)
artifact(javadocJar)
}

tasks.withType<PublishToMavenRepository>().configureEach {
dependsOn(tasks.withType<Sign>())
}
}

// Pom configuration
infix fun <T> Property<T>.by(value: T) {
set(value)
}

fun MavenPom.configureMavenCentralMetadata(project: Project) {
name by project.name
description by "Kotlin/Multiplatform SDK for The Open Network"
url by "https://github.com/ton-community/ton-kotlin"

licenses {
license {
name by "The Apache Software License, Version 2.0"
url by "https://www.apache.org/licenses/LICENSE-2.0.txt"
distribution by "repo"
id("com.vanniktech.maven.publish")
}

mavenPublishing {
pom {
name = project.name
description = "Kotlin/Multiplatform SDK for The Open Network"
inceptionYear = "2025"
url = "https://github.com/ton-community/ton-kotlin"

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 by "andreypfau"
name by "Andrey Pfau"
email by "andreypfau@ton.org"
developers {
developer {
id = "andreypfau"
name = "Andrey Pfau"
email = "andreypfau@ton.org"
}
}
}

scm {
url by "https://github.com/ton-community/ton-kotlin"
}
}

fun MavenPublication.mavenCentralArtifacts(project: Project, sources: SourceDirectorySet) {
val sourcesJar by project.tasks.creating(Jar::class) {
archiveClassifier.set("sources")
from(sources)
}
val javadocJar by project.tasks.creating(Jar::class) {
archiveClassifier.set("javadoc")
// contents are deliberately left empty
}
artifact(sourcesJar)
artifact(javadocJar)
}


fun mavenRepositoryUri(): URI {
val repositoryId: String? = System.getenv("SONATYPE_REPOSITORY_ID")
return if (repositoryId == null) {
URI("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
} else {
URI("https://s01.oss.sonatype.org/service/local/staging/deployByRepositoryId/$repositoryId")
}
}

fun RepositoryHandler.configureMavenPublication(project: Project) {
maven {
url = mavenRepositoryUri()
credentials {
username = project.getSensitiveProperty("OSSRH_USERNAME")
password = project.getSensitiveProperty("OSSRH_PASSWORD")
}
}

mavenLocal()
}

fun Project.configureEmptyJavadocArtifact(): Jar {
val javadocJar by project.tasks.creating(Jar::class) {
archiveClassifier.set("javadoc")
// contents are deliberately left empty
}
return javadocJar
}

fun signPublicationIfKeyPresent(project: Project, publication: MavenPublication) {
val signingKey = project.getSensitiveProperty("SIGNING_SECRET_KEY")
val signingKeyPassphrase = project.getSensitiveProperty("SIGNING_PASSWORD")
if (!signingKey.isNullOrBlank()) {
project.extensions.configure<SigningExtension>("signing") {
useInMemoryPgpKeys(signingKey, signingKeyPassphrase)
sign(publication)
scm {
url = "https://github.com/ton-community/ton-kotlin"
}
}
}

fun Project.getSensitiveProperty(name: String): String? {
return project.findProperty(name) as? String ?: System.getenv(name)
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
signAllPublications()
}
25 changes: 12 additions & 13 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile
plugins {
kotlin("multiplatform") apply false
kotlin("plugin.serialization") apply false
id("io.github.gradle-nexus.publish-plugin") version "2.0.0-rc-1"

alias(libs.plugins.bcv)
}

allprojects {
group = "org.ton"
version = "0.4.0-SNAPSHOT"
group = "org.ton.kotlin"
version = "0.4.0"

repositories {
mavenCentral()
Expand All @@ -37,16 +36,16 @@ subprojects {
}
}

nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username.set(System.getenv("OSSRH_USERNAME"))
password.set(System.getenv("OSSRH_PASSWORD"))
}
}
}
//nexusPublishing {
// repositories {
// sonatype {
// nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
// snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
// username.set(System.getenv("OSSRH_USERNAME"))
// password.set(System.getenv("OSSRH_PASSWORD"))
// }
// }
//}
//val isCI = System.getenv("CI") == "true"
//val isSnapshot = System.getenv("TON_KOTLIN_SNAPSHOT") == "true"
//val disableNativeTarget = System.getenv("TON_KOTLIN_DISABLE_NATIVE_TARGET") == "true"
Expand Down
1 change: 1 addition & 0 deletions libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ hmac = { module = "io.github.andreypfau:kotlinx-crypto-hmac", version.ref = "cry

[plugins]
bcv = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "bcv" }
publish = { id = "com.vanniktech.maven.publish", version = "0.28.0" }

0 comments on commit 307e3f5

Please sign in to comment.