Browse Source

Setup creation of snapshot versions.

Made darklaf-theme and darklaf-utils be transitive dependencies to avoid confusion of classes are unavailable.
Added information about automatic library downloads and nightly builds in README.
pull/188/head
weisj 5 years ago
parent
commit
861b9162b6
  1. 22
      .github/workflows/snapshot.yml
  2. 27
      README.md
  3. 32
      build.gradle.kts
  4. 4
      core/build.gradle.kts
  5. 2
      gradle.properties
  6. 2
      property-loader/build.gradle.kts

22
.github/workflows/snapshot.yml

@ -0,0 +1,22 @@
name: Build SNAPSHOT
on:
push:
branches:
- 'master'
jobs:
linux:
name: Linux (Java 8)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 10
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Build
run: ./gradlew build -PskipAutostyle
- name: Publish
run: ./gradlew prepareVote -Prc=1 -Pgh -Prelease=false -PskipJavadoc -PghGitSourceUsername=${{ secrets.GH_GIT_USERNAME }} -PghGitSourcePassword=${{ secrets.GH_GIT_PASSWORD }} -PghNexusUsername=${{ secrets.GH_NEXUS_USERNAME }} -PghNexusPassword=${{ secrets.GH_NEXUS_PASSWORD }} -PuseInMemoryKey=true -Psigning.inMemoryKey=${{ secrets.IN_MEMORY_KEY }} -Psigning.password=${{ secrets.SIGNING_PASSWORD }}

27
README.md

@ -41,6 +41,23 @@ implementation("com.github.weisj:darklaf-core:[2.2.1,)")
implementation("com.github.weisj:darklaf-theme:[2.2.1,)") // For the themes
````
You can also use the latest nightly build.
````kotlin
repositories {
maven {
url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
}
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor(0, "seconds")
}
dependencies {
implementation("com.github.weisj:darklaf-core:latest.integration")
}
````
## Installation
The LookAndFeel can be easily installed using the `LafManager`
````java
@ -125,11 +142,13 @@ When building on Windows, you need a C++ toolchain installed to build native ext
When building on macOS you need to have XCode (or the command line tools) installed to build the native extension.
If you want to build for platforms different from your machine you can download the respective native libraries
If you want to build for platforms different from your machine the necessary binaries are automatically downloaded.
For this you have to specify a valid GithubAccessToken using `githubAccessToken` property in your local `gradle.properties` file.
The access token only needs to have the permission to read repositories.
You can also manually download the respective native libraries
from the latest successful run of the [Build Native Libraries Action](https://github.com/weisJ/darklaf/actions?query=workflow%3A%22Build+Native+Libraries%22+branch%3Amaster) and place it in the corresponding `<variant>/libraries` folder.
Further details can be found in the respective `library.md` file. The libraries are then automatically included in the jar
when building the project.
When building the project there will be a message for every library that needs to be manually included.
This is necessary if you don't have the appropriate toolchain installed, but you machine is a binary target.
**Note**: You can still build the project without the libraries, but then custom decorations won't be supported.

32
build.gradle.kts

@ -3,6 +3,8 @@ import com.github.autostyle.gradle.BaseFormatExtension
import com.github.vlsi.gradle.crlf.CrLfSpec
import com.github.vlsi.gradle.crlf.LineEndings
import com.github.vlsi.gradle.properties.dsl.props
import com.github.vlsi.gradle.properties.dsl.stringProperty
import com.github.vlsi.gradle.properties.dsl.toBool
import com.github.vlsi.gradle.publishing.dsl.simplifyXml
import com.github.vlsi.gradle.publishing.dsl.versionFromResolution
@ -17,14 +19,11 @@ val skipJavadoc by props()
val enableMavenLocal by props()
val enableGradleMetadata by props()
val skipAutostyle by props()
val isRelease = project.stringProperty("release").toBool()
val String.v: String get() = rootProject.extra["$this.version"] as String
val projectVersion = "darklaf".v
val buildVersion = projectVersion + releaseParams.snapshotSuffix
println("Building: Darklaf $buildVersion")
println(" JDK: " + System.getProperty("java.home"))
releaseParams {
tlp.set("darklaf")
organizationName.set("weisJ")
@ -32,6 +31,8 @@ releaseParams {
prefixForProperties.set("gh")
svnDistEnabled.set(false)
sitePreviewEnabled.set(false)
release.set(isRelease)
rcTag.set("v$projectVersion${releaseParams.snapshotSuffix}")
nexus {
mavenCentral()
}
@ -45,6 +46,12 @@ releaseParams {
}
}
tasks.closeRepository.configure { enabled = isRelease }
val buildVersion = projectVersion + releaseParams.snapshotSuffix
println("Building: Darklaf $buildVersion")
println(" JDK: " + System.getProperty("java.home"))
fun BaseFormatExtension.license(addition: String = "") {
val extra = if (addition.isEmpty()) "" else "\n$addition"
licenseHeader(File("${project.rootDir}/LICENSE").readText() + extra) {
@ -194,7 +201,7 @@ allprojects {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
if (!skipJavadoc) {
if (!skipJavadoc && isRelease) {
withJavadocJar()
}
}
@ -214,6 +221,19 @@ allprojects {
apply(plugin = "maven-publish")
val useInMemoryKey by props()
if (useInMemoryKey) {
apply(plugin = "signing")
configure<SigningExtension> {
useInMemoryPgpKeys(
project.stringProperty("signing.inMemoryKey")?.replace("#", "\n"),
project.stringProperty("signing.password")
)
}
}
tasks {
withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
@ -295,7 +315,7 @@ allprojects {
publications {
create<MavenPublication>(project.name) {
artifactId = project.name
version = rootProject.version.toString()
version = buildVersion
description = project.description
from(project.components["java"])
}

4
core/build.gradle.kts

@ -4,9 +4,9 @@ plugins {
}
dependencies {
implementation(project(":darklaf-theme"))
api(project(":darklaf-theme"))
api(project(":darklaf-utils"))
implementation(project(":darklaf-native-utils"))
implementation(project(":darklaf-utils"))
implementation(project(":darklaf-platform-base"))
implementation(project(":darklaf-windows"))
implementation(project(":darklaf-macos"))

2
gradle.properties

@ -6,7 +6,7 @@ kotlin.code.style = official
systemProp.org.gradle.internal.publish.checksums.insecure = true
# Darklaf version
darklaf.version = 2.2.1
darklaf.version = 2.2.2
# Plugins
shadow.version = 5.1.0

2
property-loader/build.gradle.kts

@ -3,6 +3,6 @@ plugins {
}
dependencies {
implementation(project(":darklaf-utils"))
api(project(":darklaf-utils"))
implementation("com.formdev:svgSalamander")
}

Loading…
Cancel
Save