Skip to content

Commit

Permalink
fix: various gradle issues
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessioGr committed May 4, 2024
1 parent bdd827a commit 41aff48
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 19 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/gradle-publish-to-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
java-version: '17'
java-version: '21'
distribution: 'adopt'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- name: Build with Gradle
uses: gradle/gradle-build-action@4137be6a8bf7d7133955359dbd952c0ca73b1021
with:
arguments: clean build reobfJar
arguments: clean build

# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
# the publishing section of your build.gradle
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
java-version: '17'
java-version: '21'
distribution: 'adopt'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
Expand All @@ -33,7 +33,7 @@ jobs:
## run: gradle shadowJar

- name: Build artifacts
run: ./gradlew clean build reobfJar
run: ./gradlew clean build
- name: Upload build artifacts
uses: actions/upload-artifact@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You can find the releases here: https://github.com/AlessioGr/NotQuests/releases.
Do not commit your translations on GitHub. Instead, use translate.notquests.com. Translations are always welcome :) Check https://translate.notquests.com/notquests#readme before translating.

## How to build
Git clone this project and build it with these Gradle commands: `clean build reobfJar`
Git clone this project and build it with these Gradle commands: `clean build`

The output file should be in the folder `plugin/build/libs/plugin-version.jar`

Expand Down
10 changes: 5 additions & 5 deletions paper/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.JavaVersion.*


plugins {
id("io.papermc.paperweight.userdev")
id("xyz.jpenilla.run-paper")
Expand Down Expand Up @@ -350,9 +350,7 @@ tasks {
//build {
// dependsOn(shadowJar)
//}
assemble {
dependsOn(reobfJar)
}




Expand All @@ -361,7 +359,7 @@ tasks {
}*/

compileJava {
dependsOn(":common:jar")
mustRunAfter(":common:jar")

options.encoding = Charsets.UTF_8.name()
options.release.set(21)
Expand All @@ -379,3 +377,5 @@ tasks {
minecraftVersion("1.20.6")
}
}


13 changes: 9 additions & 4 deletions plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*/

import org.gradle.api.JavaVersion.*
import net.minecrell.pluginyml.bukkit.BukkitPluginDescription
import net.minecrell.pluginyml.paper.PaperPluginDescription

plugins {

Expand Down Expand Up @@ -154,11 +156,12 @@ val shadowPath = "rocks.gravili.notquests"

tasks {
// Run reobfJar on build
//build {
// dependsOn(shadowJar)
//}
build {
dependsOn(shadowJar)
}
shadowJar {
minimize()
archiveClassifier.set("")

//relocate("rocks.gravili.notquests.spigot", "$shadowPath.spigot")
//relocate("rocks.gravili.notquests.paper", "$shadowPath.paper")
Expand All @@ -170,12 +173,13 @@ tasks {
include(dependency("io.papermc:paperlib:"))
}
//archiveBaseName.set("notquests")
archiveClassifier.set("")
//archiveClassifier.set(null)
}


compileJava {
dependsOn(":common:jar", ":paper:jar", ":paper:build")

options.encoding = Charsets.UTF_8.name()
options.release.set(21)
}
Expand Down Expand Up @@ -243,6 +247,7 @@ bukkit {
)

load = net.minecrell.pluginyml.bukkit.BukkitPluginDescription.PluginLoadOrder.POSTWORLD

permissions {
register("notquests.admin"){
default = net.minecrell.pluginyml.bukkit.BukkitPluginDescription.Permission.Default.OP
Expand Down
5 changes: 2 additions & 3 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ pluginManagement {

rootProject.name = "notquests"

include(":plugin")
include(":paper")
include(":common")

include(":paper")
include(":plugin")

0 comments on commit 41aff48

Please sign in to comment.