Skip to content

Commit

Permalink
livestreams work finally
Browse files Browse the repository at this point in the history
  • Loading branch information
Mysticpasta1 committed Mar 4, 2023
1 parent 86cf1b6 commit 6e6590e
Show file tree
Hide file tree
Showing 7 changed files with 251 additions and 122 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "java-cef"]
path = java-cef
url = https://github.com/CinemaMod/java-cef.git
265 changes: 161 additions & 104 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net' }
mavenCentral()
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
}
import net.minecraftforge.gradle.patcher.tasks.ReobfuscateJar

plugins {
id "de.undercouch.download" version "5.3.0"
id 'eclipse'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '5.1.+'
id 'org.spongepowered.mixin' version '0.7.+'
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
//apply from: 'https://raw.githubusercontent.com/SizableShrimp/Forge-Class-Remapper/main/classremapper.gradle'

version = mod_version
group = maven_group // http://maven.apache.org/guides/mini/guide-naming-conventions.html
Expand All @@ -21,88 +15,84 @@ java.toolchain.languageVersion = JavaLanguageVersion.of(17)

println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft {
mappings channel: 'official', version: '1.19'
//accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
runs {
client {
properties 'mixin.env.remapRefMap': 'true'
property 'mixin.env.refMapRemappingFile', "${project.projectDir}/build/createSrgToMcp/output.srg"
workingDirectory project.file('run')
arg "-mixin.config=forgecef.mixins.json"
property 'forge.logging.console.level', 'debug'

mods {
citadel {
source sourceSets.main
}
}
}

server {
properties 'mixin.env.remapRefMap': 'true'
property 'mixin.env.refMapRemappingFile', "${project.projectDir}/build/createSrgToMcp/output.srg"
workingDirectory project.file('run')
arg "-mixin.config=forgecef.mixins.json"


property 'forge.logging.console.level', 'debug'

mods {
citadel {
source sourceSets.main
}
}
}

data {
workingDirectory project.file('run')
properties 'mixin.env.remapRefMap': 'true'
property 'mixin.env.refMapRemappingFile', "${project.projectDir}/build/createSrgToMcp/output.srg"
property 'forge.logging.console.level', 'debug'
args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/'), '--existing', sourceSets.main.resources.srcDirs[0]
mods {
citadel {
source sourceSets.main
}
}
}
}
mappings channel: 'official', version: '1.19'
//accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
runs {
client {
properties 'mixin.env.remapRefMap': 'true'
property 'mixin.env.refMapRemappingFile', "${project.projectDir}/build/createSrgToMcp/output.srg"
workingDirectory project.file('run')
arg "-mixin.config=forgecef.mixins.json"
property 'forge.logging.console.level', 'debug'

mods {
citadel {
source sourceSets.main
}
}
}

server {
properties 'mixin.env.remapRefMap': 'true'
property 'mixin.env.refMapRemappingFile', "${project.projectDir}/build/createSrgToMcp/output.srg"
workingDirectory project.file('run')
arg "-mixin.config=forgecef.mixins.json"


property 'forge.logging.console.level', 'debug'

mods {
citadel {
source sourceSets.main
}
}
}

data {
workingDirectory project.file('run')
properties 'mixin.env.remapRefMap': 'true'
property 'mixin.env.refMapRemappingFile', "${project.projectDir}/build/createSrgToMcp/output.srg"
property 'forge.logging.console.level', 'debug'
args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/'), '--existing', sourceSets.main.resources.srcDirs[0]
mods {
citadel {
source sourceSets.main
}
}
}
}
}

repositories{
maven {
name = "CurseMaven"
url = "https://www.cursemaven.com"
content {
includeGroup "curse.maven"
}
}
mavenCentral()
repositories {
maven {
name = "CurseMaven"
url = "https://www.cursemaven.com"
content {
includeGroup "curse.maven"
}
}
mavenCentral()
}

dependencies {
minecraft 'net.minecraftforge:forge:1.19.2-43.2.6'
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
}

sourceSets {
main.resources.srcDirs += 'src/generated/resources'
minecraft 'net.minecraftforge:forge:1.19.2-43.2.6'
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
}

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

// Example configuration to allow publishing using the maven-publish task
Expand All @@ -111,29 +101,96 @@ jar {
// Note you'll need to add a repository here
def reobfFile = file("$buildDir/reobfJar/output.jar")
def reobfArtifact = artifacts.add('default', reobfFile) {
type 'jar'
builtBy 'reobfJar'
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact reobfArtifact
}
}
repositories {
maven {
url "file:///${project.projectDir}/mcmodsrepo"
}
}
type 'jar'
builtBy 'reobfJar'
}

apply plugin: 'org.spongepowered.mixin'

mixin {
add sourceSets.main, "forgecef.refmap.json"
add sourceSets.main, "forgecef.refmap.json"
}

task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'deobf'
from sourceSets.main.output
classifier = 'deobf'
}

sourceSets {
main.resources.srcDirs += 'src/generated/resources'

jcef {
java {
srcDir "java-cef/java"
exclude "**/tests/**"
}
}

main {
compileClasspath += jcef.output
runtimeClasspath += jcef.output
}
}

import org.apache.tools.ant.taskdefs.condition.Os

// From com.cinemamod.fabric.cef.Platform enum
var platforms = ["linux_amd64", "linux_arm64", "windows_amd64", "windows_arm64", "macos_amd64", "macos_arm64"]

task downloadJcef {
for (String platform : platforms) {
try {
"https://ewr1.vultrobjects.com/cinemamod-libraries/cef/$cef_branch/$platform/manifest.txt".toURL().text.eachLine {
var fileHash = it.split(" ")[0]
var relFilePath = it.split(" ")[1]
var cefResourceUrl = "https://ewr1.vultrobjects.com/cinemamod-libraries/cef/$cef_branch/$platform/$relFilePath"
download.run {
src cefResourceUrl
dest "src/main/resources/assets/mcef/cef/$platform/$relFilePath"
overwrite false
}
if (Os.isFamily(Os.FAMILY_UNIX)) {
if (relFilePath.contains("chrome-sandbox") || relFilePath.contains("jcef_helper")) {
exec {
commandLine("chmod", "700", "src/main/resources/assets/mcef/cef/$platform/$relFilePath")
}
}
}
}
} catch (Exception e) {
println("Skipping CEF libraries for $cef_branch/$platform")
println(e.getMessage())
}
}
}

void createPlatformJarTask(String platform) {
Task platformJarTask = task("jar_$platform", type: ReobfuscateJar, dependsOn: jar) {
input = jar.archiveFile

onlyIf {
new File("src/main/resources/assets/mcef/cef/$platform").exists()
}
}

build.dependsOn(platformJarTask)
}

platforms.forEach(platform -> createPlatformJarTask(platform))

// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ archives_base_name = mcef

# Dependencies
forge_version=1.19.2-43.2.6

# CEF settings
cef_branch=4896
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.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
20 changes: 20 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven { url = 'https://maven.minecraftforge.net/' }
}
resolutionStrategy {
eachPlugin {
switch (requested.id.toString()) {
case "net.minecraftforge.gradle": {
useModule("${requested.id}:ForgeGradle:${requested.version}")
break
}
case "org.spongepowered.mixin": {
useModule("org.spongepowered:mixingradle:${requested.version}")
break;
}
}
}
}
}
Loading

0 comments on commit 6e6590e

Please sign in to comment.