Skip to content

Commit

Permalink
1.3.1: Use bintray for publishing, update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Juuxel committed Jan 8, 2021
1 parent 7f414bb commit 0feb712
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 55 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

Using the [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) format.

## [1.3.1] - 2021-01-08

### Changed
- Updated to Kotlin 1.4.21.

## [1.3.0] - 2020-02-15

### Added
- `StringReader.expect(String)`
- Expects the passed string to be at the cursor.
Expand All @@ -13,6 +19,7 @@ Using the [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) format.
- `StringReader.readUntil()` moved the cursor when `inclusive = false` and the string was empty.

## [1.2.0] - 2020-02-13

### Added
- `StringReader.getRemaining()`
- Gets everything in the string after the cursor.
Expand All @@ -21,6 +28,7 @@ Using the [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) format.
- Cursor offsets when using `readWhile()`.

## [1.1.0] - 2020-02-03

### Added
- `StringReader.readWhile((Char) -> Boolean)`
- Reads until the given predicate returns false.
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,17 @@ hello.expect('(') // throws if the next character is not '('

## Usage

You can get it from either [Jitpack](https://jitpack.io)
or the [CottonMC repository](http://server.bbkr.space:8081/artifactory/webapp/).
You can get it from my Bintray repository (might be on JCenter in the future).

Gradle:
```kotlin
repositories {
maven {
name = "Cotton"
url = uri("http://server.bbkr.space:8081/artifactory/libs-release")
url = uri("https://dl.bintray.com/juuxel/maven")
}
}

dependencies {
implementation("io.github.juuxel:leaf-through:1.0.0")
implementation("io.github.juuxel:leaf-through:1.3.1")
}
```
23 changes: 0 additions & 23 deletions artifactory.gradle

This file was deleted.

67 changes: 41 additions & 26 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
import com.jfrog.bintray.gradle.BintrayExtension
import org.jetbrains.dokka.gradle.DokkaTask

plugins {
`java-library`
`maven-publish`
id("com.jfrog.artifactory") version "4.9.0"

kotlin("jvm") version "1.3.61"
id("org.jetbrains.dokka") version "0.10.0"
id("org.jmailen.kotlinter") version "2.3.0"
kotlin("jvm") version "1.4.21"
id("org.jetbrains.dokka") version "1.4.20"
id("org.jmailen.kotlinter") version "3.3.0"
id("com.jfrog.bintray") version "1.8.5"
}

group = "io.github.juuxel"
version = "1.3.0"
version = "1.3.1"

java {
withSourcesJar()
}

repositories {
jcenter()
Expand All @@ -18,34 +25,25 @@ repositories {
dependencies {
api(kotlin("stdlib"))

val spek = "2.0.9"
testImplementation("io.strikt:strikt-core:0.23.4")
val spek = "2.0.15"
testImplementation("io.strikt:strikt-core:0.28.1")
testImplementation("org.spekframework.spek2:spek-dsl-jvm:$spek")
testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:$spek")
testRuntimeOnly(kotlin("reflect"))
}

if (file("private.gradle").exists()) apply(from = "private.gradle")
apply(from = "artifactory.gradle") // artifactory doesn't really work with a kts buildscript

val sourcesJar = tasks.create<Jar>("sourcesJar") {
group = "build"

archiveClassifier.set("sources")
from(sourceSets.getByName("main").allSource)
if (file("private.gradle").exists()) {
apply(from = "private.gradle")
}

tasks {
jar {
from("LICENSE")
}

dokka {
outputFormat = "markdown"
outputDirectory = "$buildDir/dokka"

configuration {
includes = listOf("src/docs/docs.md")
withType<DokkaTask> {
dokkaSourceSets.configureEach {
includes.from(file("src/docs/docs.md"))
}
}

Expand All @@ -54,15 +52,32 @@ tasks {
includeEngines("spek2")
}
}

build {
dependsOn(sourcesJar)
}
}

publishing {
publications.create<MavenPublication>("maven") {
from(components["java"])
artifact(tasks["sourcesJar"])
}
}

bintray {
if (project.hasProperty("bintrayUser")) {
user = project.property("bintrayUser").toString()
key = project.property("bintrayKey").toString()
} else {
println("'bintrayUser' not found -- please set up 'bintrayUser' and 'bintrayKey' before publishing")
}

pkg(closureOf<BintrayExtension.PackageConfig> {
repo = "maven"
name = "leaf-through"
setLicenses("MIT")
vcsUrl = "/~https://github.com/Juuxel/LeafThrough"

version(closureOf<BintrayExtension.VersionConfig> {
name = project.version.toString()
})
})

setPublications("maven")
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 0feb712

Please sign in to comment.