Skip to content

Commit

Permalink
Merge pull request #90 from TheProgramSrc/patch/dokka-javadoc-dependency
Browse files Browse the repository at this point in the history
Fixed dokkaJavadocJar Dependency, CHANGELOG.md & Improved Env Loader
  • Loading branch information
Im-Fran authored Feb 14, 2023
2 parents cae16dd + 0502522 commit 0069770
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
SONATYPE_PASSWORD: '${{ secrets.SONATYPE_PASSWORD }}'
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
# Set environment
env: 'prod'
ENV: 'prod'
steps:
# Checkout the Code
- name: Checkout Code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gradle-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
# Set up environment variables
env:
env: 'local' # Set to local, so it won't deploy the jar to the repos
ENV: 'local' # Set to local, so it won't deploy the jar to the repos
steps:
# Checkout code
- name: Checkout Code
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## v0.6.2 - Snapshot
* Improved .env loader
* Fixed "ENV" variable to be uppercase
* Fixed dokkaJavadocJar task dependency
* Fixed CHANGELOG.md

## v0.6.1 - Snapshot
* Added Maven Central Repository
* Updated SECURITY.md

## v0.6.0 - Snapshot
* Added Standalone support
* Improved velocity SoftwareType check
Expand Down
26 changes: 8 additions & 18 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,11 @@ plugins {
id("org.jetbrains.dokka") version "1.7.20"
}

val env = emptyMap<String, String>().toMutableMap()
env.putAll(System.getenv())
if(project.rootProject.file(".env").exists()) {
env.putAll(
project.rootProject
.file(".env")
.inputStream()
.bufferedReader()
.readLines()
.filter { it.isNotBlank() && !it.startsWith("#") }
.map { it.split("=") }
.associate { it[0] to it[1] }
)
}
val projectVersion = env["VERSION"] ?: "0.6.1-SNAPSHOT"
val env = project.rootProject.file(".env").let { file ->
if(file.exists()) file.readLines().filter { it.isNotBlank() && !it.startsWith("#") && it.split("=").size == 2 }.associate { it.split("=")[0] to it.split("=")[1] } else emptyMap()
}.toMutableMap().apply { putAll(System.getenv()) }

val projectVersion = env["VERSION"] ?: "0.6.2-SNAPSHOT"

group = "xyz.theprogramsrc"
version = projectVersion.replaceFirst("v", "").replace("/", "")
Expand All @@ -44,7 +34,7 @@ repositories {
}

dependencies {
compileOnly("org.spigotmc:spigot-api:1.19.2-R0.1-SNAPSHOT")
compileOnly("org.spigotmc:spigot-api:1.19.3-R0.1-SNAPSHOT")
compileOnly("net.md-5:bungeecord-api:1.19-R0.1-SNAPSHOT")
compileOnly("com.velocitypowered:velocity-api:3.1.2-SNAPSHOT")

Expand Down Expand Up @@ -130,14 +120,14 @@ configurations {
}

val dokkaJavadocJar by tasks.register<Jar>("dokkaJavadocJar") {
dependsOn(tasks.dokkaJavadoc)
dependsOn(tasks.dokkaJavadoc, tasks.dokkaHtml)
from(tasks.dokkaJavadoc.flatMap { it.outputDirectory })
archiveClassifier.set("javadoc")
}

publishing {
repositories {
if (env["env"] == "prod") {
if (env["ENV"] == "prod") {
if (env.containsKey("GITHUB_ACTOR") && env.containsKey("GITHUB_TOKEN")) {
maven {
name = "GithubPackages"
Expand Down

0 comments on commit 0069770

Please sign in to comment.