Skip to content

Commit

Permalink
JCEF Update, start multi-platform support, other general updates
Browse files Browse the repository at this point in the history
JCEF has been updated to chromiumembedded/java-cef@62432af

With the JCEF package update, comes the requirement for a newer version of the JCEF/CEF binaries.
I created a new JCEF mirror "Ruinscraft JCEF Mirror" at https://storage.googleapis.com/ruinscraft-mcef-mirror

The old JCEF mirror at https://montoyo.net/jcef has been removed.
The newer JCEF package won't work with the old binaries hosted there anyways.

This is an in-progress commit. I am working on fully supporting win64, linux64, and mac64 (intel only, I don't have an M1 mac)

There are a lot of changes but I maintain comatibility for dependants such as webdisplays
  • Loading branch information
ds58 committed Jun 18, 2021
1 parent db8953e commit 8169d1f
Show file tree
Hide file tree
Showing 84 changed files with 2,039 additions and 1,948 deletions.
3 changes: 0 additions & 3 deletions TODO.md

This file was deleted.

274 changes: 104 additions & 170 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,170 +1,104 @@
buildscript {
repositories {
jcenter()
maven { url = "http://files.minecraftforge.net/maven" }
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.


version = "1.12.2-1.20"
group = "net.montoyo.mcef"
archivesBaseName = "mcef"
def enableSigning = false

sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
}

minecraft {
version = "1.12.2-14.23.5.2768"
runDir = "run"

// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = "snapshot_20171003"
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
}

//MCEF: update Let's Encrypt root certificate before building
task importLetsEncryptCertificate {
def target = new File(sourceSets.main.resources.srcDirs.first(), "assets/mcef/r3.crt")
if(target.exists())
target.delete()

new URL("https://montoyo.net/ShareX/root.crt").withInputStream { i -> target.withOutputStream { it << i }}
println "updated let's encrypt root certificate"
}

processResources.dependsOn importLetsEncryptCertificate

//MCEF: Generate unobfuscated JAR that can be added to the 'libs' folder
task apiJar(type: Jar) {
from sourceSets.main.output
classifier = 'api'

manifest {
attributes 'FMLCorePlugin': 'net.montoyo.mcef.coremod.ShutdownPatcher'
attributes 'FMLCorePluginContainsMod': 'true'
}
}

//Generate coremod JAR
import groovy.swing.SwingBuilder

task coremodJar(type: Jar) {
from(sourceSets.main.output) {
include 'net/montoyo/mcef/coremod/**'
}

manifest {
attributes 'FMLCorePlugin': 'net.montoyo.mcef.coremod.ShutdownPatcher'
}

classifier = 'coremod'

doLast {
if(enableSigning) {
def keyAlias = ''
def keyFile = ''
def keyPswd = ''
def dstDir = new File(coremodJar.destinationDir, 'signed')
dstDir.mkdirs()

new SwingBuilder().edt {
dialog(modal: true,
title: 'Signing details required',
alwaysOnTop: true,
resizable: false,
locationRelativeTo: null,
pack: true,
show: true) {
vbox {
label(text: 'Key File:')
input1 = textField()
label(text: 'Key Alias:')
input2 = textField()
label(text: 'Key Password:')
input3 = passwordField()
button(defaultButton: true, text: 'Sign', actionPerformed: {
keyFile = input1.text
keyAlias = input2.text
keyPswd = new String(input3.password)
dispose()
})
}
}
}

ant.signjar(
jar: coremodJar.archivePath.absolutePath,
destDir: dstDir.absolutePath,
alias: keyAlias,
storetype: 'jks',
keystore: keyFile,
storepass: keyPswd,
verbose: true,
preservelastmodified: 'true'
)
}
}
}

reobf {
coremodJar { mappingType = 'SEARGE' }
}

jar {
exclude 'net/montoyo/mcef/coremod/**'

File signedCoremod
if(enableSigning)
signedCoremod = new File(new File(coremodJar.destinationDir, 'signed'), coremodJar.archivePath.name)
else
signedCoremod = coremodJar.archivePath

from(signedCoremod.absolutePath) {
include '*'
}

manifest {
attributes 'ContainedDeps': coremodJar.archivePath.name
attributes 'Main-Class': 'net.montoyo.mcef.setup.SetupUI'
}

dependsOn reobfCoremodJar
}

artifacts {
archives apiJar
}

dependencies {
}

processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version

// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'

// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
}

// copy everything else except the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
mavenCentral()
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:3.+'
}
}

apply plugin: 'net.minecraftforge.gradle'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
apply plugin: 'maven-publish'

version = '1.12.2-1.20'
group = 'net.montoyo.mcef'
archivesBaseName = 'mcef'

sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.

minecraft {
// The mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD Snapshot are built nightly.
// stable_# Stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace.
//mappings channel: 'snapshot', version: '20171003-1.12'
mappings channel: 'snapshot', version: '20171003-1.12'
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.

// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
client {
workingDirectory project.file('run')

// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'

// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
}

server {

// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'

// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
}
}
}

dependencies {
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2855'

// You may put jars on which you depend on in ./libs or you may define them like so..
// compile "some.group:artifact:version:classifier"
// compile "some.group:artifact:version"

// Real examples
// compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
// compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env

// The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
// provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'

// These dependencies get remapped to your current MCP mappings
// deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'

// For more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html

}

// Example for how to get properties into the manifest for reading by the runtime..
jar {
manifest {
attributes([
"Specification-Title": "examplemod",
"Specification-Vendor": "examplemodsareus",
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"examplemodsareus",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}

// Example configuration to allow publishing using the maven-publish task
// This is the preferred method to reobfuscate your jar file
jar.finalizedBy('reobfJar')
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
//publish.dependsOn('reobfJar')
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
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,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
Loading

0 comments on commit 8169d1f

Please sign in to comment.