This repository has been archived by the owner on Apr 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Fabricization #4
Open
i509VCB
wants to merge
5
commits into
master
Choose a base branch
from
cleanup/workaround
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d006160
Not ready, just testing
i509VCB d96cb82
Allow registration of rules
i509VCB 51b4821
Temporary workaround for loom bug
i509VCB 8f28a00
Workaround and checkstyle complaint
i509VCB 3f2a1cc
Make enum rules use ordinals for saving.
i509VCB File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created | ||
# For more information see: https://github.com/actions/setup-java#publishing-using-gradle | ||
|
||
name: Gradle Package | ||
|
||
on: push | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
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 | ||
run: gradle build | ||
|
||
# The USERNAME and PASSWORD need to correspond to the credentials environment variables used in | ||
# the publishing section of your build.gradle | ||
- name: Publish to GitHub Packages | ||
run: gradle publish | ||
env: | ||
BRANCH_NAME: ${{ github.ref }} | ||
RUN_COUNT: ${{ github.run_number }} | ||
REPO_NAME: ${{ github.repository }} | ||
USERNAME: ${{ github.actor }} | ||
PASSWORD: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,29 @@ | ||
.idea/ | ||
build/ | ||
run/ | ||
.gradle/ | ||
# Compiled nonsense that does not belong in *source* control | ||
/build | ||
/bin | ||
/.gradle | ||
/minecraft | ||
/out | ||
/run | ||
/classes | ||
|
||
# IDE nonsense that could go in source control but really shouldn't | ||
.classpath | ||
.project | ||
.metadata | ||
.settings | ||
*.launch | ||
*.iml | ||
.idea | ||
*.ipr | ||
*.iws | ||
|
||
# Sekrit files | ||
private.properties | ||
private.gradle | ||
|
||
# Files from bad operating systems :^) | ||
Thumbs.db | ||
.DS_Store | ||
local.properties | ||
.directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
Copyright 2019 Martmists | ||
Copyright 2020 FabLabsMC | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,128 @@ | ||
buildscript { | ||
dependencies { | ||
classpath "net.fabricmc:fabric-loom:0.2.7-SNAPSHOT" | ||
plugins { | ||
id "java" | ||
id "eclipse" | ||
id "idea" | ||
id "fabric-loom" version "0.2.7-SNAPSHOT" | ||
id "maven-publish" | ||
id "checkstyle" | ||
} | ||
|
||
sourceCompatibility = 1.8 | ||
targetCompatibility = 1.8 | ||
|
||
// Elytra version format - notes branch, commit count, and dirty in version string | ||
def branch | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs cleaning up |
||
if (System.env.BRANCH_NAME) { | ||
// CI support | ||
branch = System.env.BRANCH_NAME | ||
branch = branch.substring(branch.lastIndexOf("/")+1) | ||
} else { | ||
branch = "git rev-parse --abbrev-ref HEAD".execute().in.text.trim() | ||
} | ||
if (branch == "HEAD") { | ||
branch = "git rev-parse --short HEAD".execute().in.text.trim() | ||
} | ||
def commits | ||
if (System.env.RUN_COUNT) { | ||
//CI support, for some reason github actions doesn't like getting the rev-list count | ||
commits = System.env.RUN_COUNT | ||
} else { | ||
commits = "git rev-list --count HEAD".execute().in.text.trim() | ||
} | ||
def dirty = !"git diff-index HEAD".execute().in.text.trim().isEmpty() | ||
|
||
def libName = "${project.library_name}" | ||
def libVer = "${project.library_version}" | ||
archivesBaseName = "fablabs-" + libName + "-v" + libVer | ||
group = "${project.maven_group}" | ||
version = branch + "-${project.mod_version}" + "." + commits + (dirty ? "-dirty" : "") + "+${project.minecraft_version}" | ||
def modVersion = "${project.mod_version}" + "-" + commits + "+${project.minecraft_version}" // semver-compatible version string for use in fabric.mod.json | ||
def modRepo | ||
if (System.env.REPO_NAME) { | ||
modRepo = System.env.REPO_NAME | ||
} else { | ||
modRepo = "FabLabsMC/${project.library_name}" | ||
} | ||
|
||
minecraft { | ||
accessWidener = file("src/main/resources/libgamerule.accesswidener") | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { url "http://maven.fabricmc.net/" } // Fabric maven - home of Fabric API and ModMenu | ||
} | ||
|
||
dependencies { | ||
minecraft "com.mojang:minecraft:${project.minecraft_version}" | ||
mappings "net.fabricmc:yarn:${project.minecraft_version}+build.${project.yarn_build}:v2" | ||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" | ||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" | ||
// compileOnly "com.google.code.findbugs:jsr305:3.0.2" //TODO: what are we going to do for annotations? | ||
} | ||
|
||
checkstyle { | ||
configFile = rootProject.file("checkstyle.xml") | ||
toolVersion = '8.25' | ||
} | ||
|
||
processResources { | ||
inputs.property "version", modVersion | ||
inputs.property "id", project.archivesBaseName | ||
inputs.property "repo", modRepo | ||
inputs.property "libname", libName | ||
inputs.property "libver", libVer | ||
from(sourceSets.main.resources.srcDirs) { | ||
include "fabric.mod.json" | ||
expand version: modVersion, id: project.archivesBaseName, repo: modRepo, libname: libName, libver: libVer | ||
} | ||
repositories { | ||
maven { | ||
name = 'Fabric' | ||
url = 'https://maven.fabricmc.net/' | ||
} | ||
gradlePluginPortal() | ||
from(sourceSets.main.resources.srcDirs) { | ||
exclude "fabric.mod.json" | ||
} | ||
} | ||
|
||
apply plugin: "idea" | ||
|
||
// 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" | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { | ||
url 'https://jitpack.io' | ||
// 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 | ||
} | ||
|
||
jar { | ||
from "LICENSE" | ||
} | ||
|
||
// configure the maven publication | ||
publishing { | ||
repositories { | ||
maven { | ||
name = "GitHubPackages" | ||
url = uri("https://maven.pkg.github.com/" + modRepo.toLowerCase()) | ||
credentials { | ||
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME") | ||
password = project.findProperty("gpr.key") ?: System.getenv("PASSWORD") | ||
} | ||
} | ||
// uncomment to publish to the local maven | ||
// mavenLocal() | ||
} | ||
publications { | ||
mavenJava(MavenPublication) { | ||
// add all the jars that should be included when publishing to maven | ||
artifact(remapJar) { | ||
builtBy remapJar | ||
} | ||
artifact(sourcesJar) { | ||
builtBy remapSourcesJar | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure we can keep this in FabLabs, then.