Skip to content

Commit

Permalink
Maven publish in build, added gradle dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
maltaisn committed Sep 12, 2019
1 parent 70e7935 commit f7d44b8
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 17 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ sharp corners at any size and SDF is used for shadow effects to keep round corne
The library can also render normal MSDF and SDF but shadows won't work.

#### Gradle dependency
COMING SOON.

The library is compatible with LibGDX 1.9.10 and up.
```
implementation("com.maltaisn:msdf-gdx:X.Y.Z")
```
Replace `X.Y.Z` with the lastest version: ![Maven Central](https://img.shields.io/maven-central/v/com.maltaisn/msdf-gdx)

## Usage

Expand Down Expand Up @@ -160,6 +161,13 @@ The result should look like this:

The library can also render normal MSDF and SDF but shadows won't work.

## Changelog
See [changelog](CHANGELOG.md).

# License
- Code is licensed under [Apache License, Version 2.0](LICENSE).
- Test font (roboto) is licensed under Apache License, Version 2.0.

### References
- [msdfgen][msdfgen] by Chlumsky who developed the MSDF technique.
- [msdf-bmfont-xml][msdf-bmfont-xml] by soimy, used to create font texture atlas.
Expand Down
9 changes: 2 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
buildscript {
val libVersion by extra("0.1.0")

val kotlinVersion by extra("1.3.50")
val gdxVersion by extra("1.9.10")
val ktxVersion by extra("1.9.10-b1")
val junitVersion by extra("4.12")

val kotlinVersion: String by project
repositories {
gradlePluginPortal()
google()
Expand All @@ -24,5 +18,6 @@ allprojects {
repositories {
jcenter()
google()
mavenCentral()
}
}
7 changes: 6 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
org.gradle.jvmargs=-Xms1G -Xmx3G
org.gradle.parallel=true
org.gradle.caching=true

libVersion=0.1.0
kotlinVersion=1.3.50
gdxVersion=1.9.10
ktxVersion=1.9.10-b1
junitVersion=4.12
36 changes: 31 additions & 5 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
kotlin("jvm")
`maven-publish`
signing
}

dependencies {
Expand All @@ -20,6 +21,7 @@ java {

sourceSets {
main {
// This is needed to keep shader files in classpath.
resources.srcDir("src/main/java")
}
}
Expand All @@ -40,28 +42,52 @@ tasks.register<Jar>("javadocJar") {
publishing {
publications {
create<MavenPublication>("maven") {
val libVersion: String by project
groupId = "com.maltaisn"
artifactId = "msdfgdx"
version = rootProject.extra["libVersion"] as String
artifactId = "msdf-gdx"
version = libVersion

pom {
name.set("Card game")
description.set("Card game base application")
name.set("msdf-gdx")
description.set("Provides lightweight utilities to draw MSDF text on LibGDX.")
url.set("https://github.com/maltaisn/msdf-gdx")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
}
}
developers {
developer {
id.set("maltaisn")
}
}
scm {
url.set("https://github.com/maltaisn/msdf-gdx")
connection.set("scm:git:git://github.com/maltaisn/msdf-gdx.git")
developerConnection.set("scm:git:ssh://[email protected]:maltaisn/msdf-gdx.git")
}
}

from(components["java"])
artifact(tasks["sourcesJar"])
//artifact(tasks["javadocJar"])
artifact(tasks["javadocJar"])
}
}
repositories {
val ossrhUsername: String by project
val ossrhPassword: String by project
maven {
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
this.username = ossrhUsername
this.password = ossrhPassword
}
}
}
}

signing {
sign(publishing.publications["maven"])
}
3 changes: 2 additions & 1 deletion test/test-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ dependencies {
val ktxVersion: String by project
val junitVersion: String by project

api(project(":lib"))
//api(project(":lib"))
api("com.maltaisn:msdf-gdx:0.1.0")

implementation(kotlin("stdlib"))

Expand Down

0 comments on commit f7d44b8

Please sign in to comment.