Skip to content

Commit

Permalink
Move to Maven Central
Browse files Browse the repository at this point in the history
  • Loading branch information
azabost committed Apr 22, 2023
1 parent 62e91a6 commit acf8545
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 50 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: Build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
on: [ push, pull_request ]

jobs:
build:
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![](https://jitpack.io/v/bright/codified.svg)](https://jitpack.io/#bright/codified)
![build](https://github.com/bright/codified/actions/workflows/build.yml/badge.svg?branch=master)

# codified #

Expand All @@ -8,11 +8,11 @@ At the moment, the main application of this library is making it easier to encod

## Installation and usage ##

First, add JitPack to your repositories block in Gradle build script.
First, make sure Maven Central is in your repositories block in Gradle build script.

```kotlin
repositories {
maven("https://jitpack.io")
mavenCentral()
}
```

Expand All @@ -21,7 +21,7 @@ repositories {
Add the following dependency in order to access `CodifiedEnum` class.

```kotlin
implementation("com.github.bright.codified:enums:1.6.21")
implementation("dev.bright.codified:enums:1.6.21.1")
```

`CodifiedEnum` is a sealed class which represents either "known" or "unknown" enum type depending on the `code`
Expand Down Expand Up @@ -58,7 +58,7 @@ Add the following dependency in order to access `CodifiedEnum` serializer using
[Kotlin serialization](https://github.com/Kotlin/kotlinx.serialization).

```kotlin
implementation("com.github.bright.codified:enums-serializer:1.6.21")
implementation("dev.bright.codified:enums-serializer:1.6.21.1")
```

Add `CodifiedSerializer` object for your enum class to handle both known and unknown enum types.
Expand Down
24 changes: 1 addition & 23 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,31 +1,9 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version Versions.kotlin
id("default-config")
id("default-java-publish")
}

allprojects {
group = Config.group
version = Config.version

repositories {
mavenCentral()
maven(Repositories.jitpack)
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = Config.jvmTarget
}

tasks.withType<Test> {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
}

dependencies {
implementation(kotlin("stdlib"))
}
8 changes: 4 additions & 4 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
repositories {
gradlePluginPortal()
}

plugins {
`kotlin-dsl`
`kotlin-dsl-precompiled-script-plugins`
}

repositories {
jcenter()
}
6 changes: 3 additions & 3 deletions buildSrc/src/main/kotlin/Config.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
object Config {
val group = "pl.brightinventions.codified"
val version = "1.5.2"
val jvmTarget = "1.8"
val group = "dev.bright.codified"
val version = "1.6.21.1"
val jvmToolchain = 8
}
21 changes: 21 additions & 0 deletions buildSrc/src/main/kotlin/default-config.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
plugins {
`java-library`
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(Config.jvmToolchain))
}
}

tasks.withType<Test> {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}

repositories {
mavenCentral()
maven(Repositories.jitpack)
}
55 changes: 55 additions & 0 deletions buildSrc/src/main/kotlin/default-java-publish.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,66 @@
plugins {
`java-library`
`maven-publish`
signing
}

group = Config.group
version = Config.version

java {
withJavadocJar()
withSourcesJar()
}

publishing {
publications {
register<MavenPublication>("default") {
from(components["java"])

pom {
name.set("Codified")
description.set("Facilitates codification of objects (mainly enums)")
url.set("https://github.com/bright/codified")

licenses {
license {
name.set("MIT License")
url.set("http://www.opensource.org/licenses/mit-license.php")
}
}

developers {
developer {
name.set("Andrzej Zabost")
email.set("[email protected]")
organization.set("Bright Inventions")
organizationUrl.set("https://brightinventions.pl/")
}
}

scm {
connection.set("scm:git:git://github.com/bright/codified.git")
developerConnection.set("scm:git:ssh://github.com:bright/codified.git")
url.set("https://github.com/bright/codified/tree/master")
}
}
}

repositories {
maven {
name = "MavenCentralStaging"
setUrl("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials(PasswordCredentials::class)
}
maven {
name = "MavenCentralSnapshots"
setUrl("https://s01.oss.sonatype.org/content/repositories/snapshots/")
credentials(PasswordCredentials::class)
}
}
}
}

signing {
sign(publishing.publications)
}
6 changes: 1 addition & 5 deletions enums-serializer/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
plugins {
kotlin("jvm")
kotlin("plugin.serialization") version Versions.kotlin
id("default-config")
id("default-java-publish")
}

java {
withJavadocJar()
withSourcesJar()
}

dependencies {
implementation(kotlin("stdlib"))
api(project(":enums"))
Expand Down
6 changes: 1 addition & 5 deletions enums/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
plugins {
kotlin("jvm")
id("default-config")
id("default-java-publish")
}

java {
withJavadocJar()
withSourcesJar()
}

dependencies {
implementation(kotlin("stdlib"))
api(rootProject)
Expand Down

0 comments on commit acf8545

Please sign in to comment.