Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
distribution: 'temurin'
java-version: 17
- name: Build artifacts
run: ./gradlew build -Pbuild.release=true
run: ./gradlew --dependency-verification strict build -Pbuild.release=true
- name: Upload assets to GitHub
uses: AButler/upload-release-assets@v2.0
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
restore-keys: |
${{ runner.os }}-build-snapshot-
- name: Build artifacts
run: ./gradlew build
run: ./gradlew --dependency-verification strict build
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
Expand Down
48 changes: 43 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,50 @@ jar {
from sourceSets.api.output.resourcesDir
}

dependencies {
//to change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
repositories {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entire repositories block is not strictly required either but prevents downloading artifacts from the wrong place.

// Log if any unknown repositories were added non-explicitly.
forEach { repo ->
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed if you don't like it.

if (repo.name == 'Fabric' || repo.name == 'Mojang' || repo.name == 'MavenRepo') {
// We know these exist already.
return
}
var url = repo.url as URI
var protocol = url.getScheme()
if (protocol == "file") {
// Local repositories are most likely safe.
return
}
println("[Sodium] Unknown repository \"${repo.name}\" with URL \"${url}\"")
}
Mojang {
content {
includeGroup('com.mojang')
}
}
Fabric {
content {
includeGroup('net.fabricmc.fabric-api')
includeGroup('net.fabricmc.unpick')
includeGroup('net.fabricmc')
}
}
// Most dependencies should be downloaded from maven central since they have the most strict security policy and most dependencies are just mirrored from maven central.
MavenRepo {
content {
// OW2 ASM is an exception which we download directly from their maven server which is signed with their PGP key.
excludeGroup('org.ow2.asm')
}
}
maven {
name 'ObjectWeb'
url 'https://repository.ow2.org/nexus/content/repositories/releases'
content {
includeGroup('org.ow2.asm')
}
}
}

dependencies {
// Fabric API
modIncludeImplementation(fabricApi.module("fabric-api-base", project.fabric_version))
modIncludeImplementation(fabricApi.module("fabric-block-view-api-v2", project.fabric_version))
Expand Down
10 changes: 10 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx2G

# Prevent gradle from auto downloading another JDK.
org.gradle.java.installations.auto-download=false

# Use lenient dependency verification by default for development purposes,
# porting to newer game versions can be harder without this.
org.gradle.dependency.verification=lenient

# Loom Properties
systemProp.loom.test.reproducible=true

# Fabric Properties
# check these on https://fabricmc.net/develop/
minecraft_version=1.20.2
Expand Down
2 changes: 2 additions & 0 deletions gradle/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Do not commit the binary pgp keyring.
verification-keyring.gpg
2,122 changes: 2,122 additions & 0 deletions gradle/verification-keyring.keys

Large diffs are not rendered by default.

1,150 changes: 1,150 additions & 0 deletions gradle/verification-metadata.xml

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions scripts/update_verification_metadata.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@echo off
if not exist gradlew.bat (
echo Not running in the base project directory.
exit /b 1
)

gradlew.bat --refresh-dependencies --write-verification-metadata sha256 clean build && gradlew.bat --refresh-dependencies --write-verification-metadata pgp,sha256 --export-keys clean build

del %~dp0gradle\verification-keyring.gpg
echo Done.
9 changes: 9 additions & 0 deletions scripts/update_verification_metadata.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
if [ ! -e gradlew ]; then
echo "Not running in the base project directory."
exit 1
fi

./gradlew --refresh-dependencies --write-verification-metadata sha256 clean build && ./gradlew --refresh-dependencies --write-verification-metadata pgp,sha256 --export-keys clean build

rm gradle/verification-keyring.gpg
echo "Done."
25 changes: 21 additions & 4 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
pluginManagement {
repositories {
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
name 'ObjectWeb'
url 'https://repository.ow2.org/nexus/content/repositories/releases'
content {
includeGroup('org.ow2.asm')
}
}
mavenCentral() // backup mirror for JCenter's Bintray, which is ordinarily used to resolve Eclipse's JGit
gradlePluginPortal()
maven {
name 'Fabric'
url 'https://maven.fabricmc.net'
content {
includeModule('fabric-loom', 'fabric-loom.gradle.plugin')
includeGroup('net.fabricmc.unpick')
includeGroup('net.fabricmc')
}
}
gradlePluginPortal {
content {
includeModule('io.github.juuxel.loom-vineflower', 'io.github.juuxel.loom-vineflower.gradle.plugin')
includeModule('io.github.juuxel', 'loom-vineflower')
}
}
mavenCentral()
}
}