Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Started to merge subprojects #12

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
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-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ jobs:
build:
uses: neoforged/actions/.github/workflows/build-prs.yml@main
with:
java: 8
java: 21
gradle_tasks: test
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
release:
uses: neoforged/actions/.github/workflows/gradle-publish.yml@main
with:
java: 8
java: 21
pre_gradle_tasks: test
gradle_tasks: publish closeAndReleaseSonatypeStagingRepository
secrets:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE-header.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
InstallerTools
Copyright (c) 2019-2021.
Copyright (c) 2019-2024.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand Down
16 changes: 0 additions & 16 deletions binarypatcher/.gitattributes

This file was deleted.

10 changes: 0 additions & 10 deletions binarypatcher/.gitignore

This file was deleted.

31 changes: 0 additions & 31 deletions binarypatcher/build.gradle

This file was deleted.

Binary file removed binarypatcher/src/test/resources/example_data.lzma
Binary file not shown.
136 changes: 75 additions & 61 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,80 +1,76 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import net.neoforged.gradleutils.PomUtilsExtension.License

plugins {
id 'org.cadixdev.licenser' version '0.6.1'
id 'com.github.johnrengelman.shadow' version '8.1.1' apply false
id 'net.neoforged.gradleutils' version '3.0.0-alpha.10' apply false
}

allprojects {
apply plugin: 'application'
apply plugin: 'maven-publish'
apply plugin: 'java-library'
apply plugin: 'net.neoforged.gradleutils'
if (project.name != 'cli-utils') {
apply plugin: 'com.github.johnrengelman.shadow'
}

group = 'net.neoforged.installertools'
java {
withJavadocJar()
withSourcesJar()
toolchain.languageVersion = JavaLanguageVersion.of(8)
}

// Gradle repositories and dependencies
buildscript {
repositories {
gradlePluginPortal()
mavenCentral()
}

gradleutils.version {
branches.suffixBranch()
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.5.0'
}
}

version = gradleutils.version
println("${project.name} version: " + version)

gradleutils.setupSigning(signAllPublications: true)

tasks.named('jar', Jar).configure {
manifest.attributes('Implementation-Version': project.version)
if (application.mainClass.getOrNull()) {
manifest.attributes('Main-Class': application.mainClass.get())
}
}
plugins {
id 'application'
id 'java'
id 'maven-publish'
id 'net.neoforged.licenser' version '0.7.5'
id 'net.neoforged.gradleutils' version '3.0.0'
id 'com.gradleup.shadow' version '8.3.4'
}

if (project.name != 'cli-utils') {
tasks.named('shadowJar', ShadowJar).configure {
archiveClassifier = 'fatjar'
// Set up automatic versioning through gradleutils
gradleutils {
version {
branches {
suffixBranch()
}
}
setupSigning(signAllPublications: true)
}
version = gradleutils.version

gradleutils {
setupSigning()
setupCentralPublishing()
}

base {
archivesName = 'installertools'
group = "net.neoforged.installertools"

java {
withJavadocJar()
withSourcesJar()
// The installertool project needs to be Java 8 compatible,
// since they have to be able to be run by the VM hosting the installer.
toolchain.languageVersion = JavaLanguageVersion.of(8)
}

application {
mainClass = 'net.neoforged.installertools.ConsoleTool'
}

license {
header project.file('LICENSE-header.txt')
include 'net/neoforged/installertools/**/*.java'
newLine false
header project.file('LICENSE-header.txt')
include 'net/neoforged/installertools/**/*.java'
exclude 'net/neoforged/installertools/binarypatcher/**/*.java'
newLine false
}

repositories {
mavenCentral()
}

dependencies {
implementation(libs.srgutils)
implementation(libs.jopt)
implementation(libs.lzma)
implementation(libs.xdelta)
implementation(libs.asm)

implementation 'com.google.code.gson:gson:2.8.9'
implementation 'de.siegmar:fastcsv:2.0.0'
implementation 'org.ow2.asm:asm-commons:9.3'
implementation project(':cli-utils')
implementation 'org.ow2.asm:asm-commons:9.7'

testImplementation(libs.bundles.junit)
}
Expand All @@ -83,6 +79,12 @@ test {
useJUnitPlatform()
}

jar {
manifest {
attributes["Implementation-Version"] = version.toString()
}
}

publishing {
publications {
mavenJava(MavenPublication) {
Expand All @@ -92,24 +94,36 @@ publishing {
pom {
name = 'Installer Tools'
description = 'A collection of command line tools that are useful for the Forge installer, that are not worth being their own standalone projects.'
pomUtils.githubRepo(it, 'InstallerTools')
pomUtils.license(it, License.LGPL_v2)
pomUtils.neoForgedDeveloper(it)
}
}
}
repositories {
maven gradleutils.publishingMaven
}
}

allprojects {
publishing {
publications {
withType(MavenPublication).configureEach {
it.pom {
pomUtils.githubRepo(it, 'InstallerTools')
pomUtils.license(it, License.LGPL_v2)
pomUtils.neoForgedDeveloper(it)
}
}
}
repositories {
maven gradleutils.publishingMaven
}
File proguardFile = file("build/libs/${jar.archiveBaseName.get()}-proguard-${version}.jar")

tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
configurations = [project.configurations.compileClasspath]
}

tasks.register('proguardJar', proguard.gradle.ProGuardTask) {
dependsOn shadowJar
outputs.upToDateWhen { false }

if (JavaLanguageVersion.current().asInt() <= 8) {
libraryjars "${System.getProperty('java.home')}/lib/rt.jar"
} else {
libraryjars "${System.getProperty('java.home')}/jmods"
}
libraryjars(configurations.compileClasspath)

injars(["filter":"!META-INF/maven/**/*"], shadowJar.archiveFile)
outjars proguardFile
configuration file("proguard.conf")
}
assemble.dependsOn proguardJar
3 changes: 3 additions & 0 deletions cli-utils/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

apply plugin : InstallerToolsPlugin

dependencies {
testImplementation(libs.bundles.junit)
}
Expand Down
24 changes: 0 additions & 24 deletions cli-utils/src/main/java/net/neoforged/cliutils/JarUtils.java

This file was deleted.

This file was deleted.

13 changes: 13 additions & 0 deletions cli/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@



plugins {
id 'com.gradleup.shadow' version '9.0.0-beta4'
}

group = 'net.neoforged.installertools'

application {
mainClassName = "net.neoforged.installertools.cli.Main"
}

7 changes: 7 additions & 0 deletions cli/src/main/java/net/neoforged/installertools/cli/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package net.neoforged.installertools.cli;

public class Main {
public static void main(String[] args) {

}
}
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

org.gradle.configuration-cache=true
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
5 changes: 4 additions & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 2 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down
16 changes: 0 additions & 16 deletions jarsplitter/.gitattributes

This file was deleted.

Loading
Loading