Skip to content

Commit

Permalink
Merge branch '1.16.x/dev' into 1.16.x/stable
Browse files Browse the repository at this point in the history
  • Loading branch information
FlashyReese committed Jun 7, 2022
2 parents ab1a6d2 + ecbfe26 commit ce44a76
Show file tree
Hide file tree
Showing 17 changed files with 215 additions and 314 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
name: Java CI with Gradle

on: [ push, pull_request ]
on: [ pull_request, push ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Upload build artifacts
uses: actions/upload-artifact@v1
with:
name: build-artifacts
path: build/libs
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Upload build artifacts
uses: actions/upload-artifact@v1
with:
name: build-artifacts
path: build/libs
7 changes: 5 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ jobs:
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Upload assets to GitHub
run: ./gradlew build
- name: Upload assets to releases
run: ./gradlew build publishAllPublicationsToFlashyReeseReleasesRepository
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
BUILD_RELEASE: ${{ github.event.prerelease == false }}
- name: Publish to Modrinth & CurseForge
uses: Kir-Antipov/mc-publish@v2.1
Expand All @@ -40,4 +42,5 @@ jobs:
dependencies: |
sodium | depends | *
sodium-extra | recommends | *
irisshaders | recommends | *
iris | recommends | *
74 changes: 53 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
plugins {
id 'org.ajoberstar.grgit' version '5.0.0'
id 'fabric-loom' version '0.11-SNAPSHOT'
id 'maven-publish'
id 'signing'
}

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

archivesBaseName = "${project.archives_base_name}-mc${project.minecraft_version}"
version = project.mod_version
archivesBaseName = project.archives_base_name
version = "${project.mod_version}+mc${project.minecraft_version}-${getVersionMetadata()}"
group = project.maven_group

repositories {
Expand Down Expand Up @@ -42,42 +44,72 @@ processResources {
}
}

// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
tasks.withType(JavaCompile).configureEach {
it.options.release = 8
}

// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
}

jar {
from "LICENSE.txt"
}


// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
from components.java
}
}

// select the repositories you want to publish to
repositories {
// uncomment to publish to the local maven
// mavenLocal()
maven {
name = "FlashyReeseReleases"
url = "https://maven.flashyreese.me/releases"
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
maven {
name = "FlashyReeseSnapshots"
url = "https://maven.flashyreese.me/snapshots"
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}

def getVersionMetadata() {
def build_id = System.getenv("GITHUB_RUN_NUMBER")

// CI builds only
if (build_id != null) {
return "build.${build_id}"
}

if (grgit != null) {
def head = grgit.head()
def id = head.abbreviatedId

// Flag the build if the build tree is not clean
if (!grgit.status().clean) {
id += "-dirty"
}

return "rev.${id}"
}

// No tracking information could be found about the build
return "unknown"
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ org.gradle.jvmargs=-Xmx1G
yarn_mappings=1.16.5+build.10
loader_version=0.13.3
# Mod Properties
mod_version=1.4.2
mod_version=1.4.3
maven_group=me.flashyreese.mods
archives_base_name=reeses_sodium_options

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,15 @@ protected BasicFrame.Builder parentFrameBuilder() {
public BasicFrame.Builder parentBasicFrameBuilder(Dim2i parentBasicFrameDim, Dim2i tabFrameDim) {
return BasicFrame.createBuilder()
.setDimension(parentBasicFrameDim)
.shouldRenderOutline(false)
.addChild(dim -> this.undoButton)
.addChild(dim -> this.applyButton)
.addChild(dim -> this.closeButton)
.addChild(dim -> this.donateButton)
.addChild(dim -> this.hideDonateButton)
.addChild(parentDim -> TabFrame.createBuilder()
.setDimension(tabFrameDim)
.shouldRenderOutline(false)
.addTabs(tabs -> this.pages.stream().filter(page -> !page.getGroups().isEmpty()).forEach(page -> tabs.add(dim -> Tab.createBuilder().from(page, dim))))
.build()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,12 @@ public abstract class AbstractFrame extends AbstractWidget implements ParentElem
protected final List<AbstractWidget> children = new ArrayList<>();
protected final List<Drawable> drawable = new ArrayList<>();
protected final List<ControlElement<?>> controlElements = new ArrayList<>();
protected boolean renderOutline = false;
protected boolean renderOutline;
private Element focused;
private boolean dragging;

public AbstractFrame(Dim2i dim) {
this.dim = dim;
}

public AbstractFrame(Dim2i dim, List<AbstractWidget> children) {
this(dim);
this.children.addAll(children);
}

public AbstractFrame(Dim2i dim, boolean renderOutline) {
this(dim);
this.renderOutline = renderOutline;
}

public AbstractFrame(Dim2i dim, List<AbstractWidget> children, boolean renderOutline) {
this(dim);
this.children.addAll(children);
this.dim = dim;
this.renderOutline = renderOutline;
}

Expand Down
Loading

0 comments on commit ce44a76

Please sign in to comment.