-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
1,315 additions
and
912 deletions.
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 |
---|---|---|
@@ -1,134 +1,71 @@ | ||
import net.minecraftforge.gradle.common.util.MinecraftExtension | ||
import java.time.Instant | ||
import java.time.ZoneId | ||
import java.time.format.DateTimeFormatter | ||
|
||
val minecraftVersion: String by extra | ||
val modVersion: String by extra | ||
val forgeVersion: String by extra | ||
|
||
buildscript { | ||
repositories { | ||
jcenter() | ||
maven("https://files.minecraftforge.net/maven") | ||
} | ||
dependencies { | ||
classpath("net.minecraftforge.gradle:ForgeGradle:3.+") | ||
} | ||
} | ||
|
||
plugins { | ||
java | ||
`maven-publish` | ||
id("net.minecraftforge.gradle") | ||
} | ||
|
||
apply(plugin = "net.minecraftforge.gradle") | ||
|
||
val mainSourceSet: SourceSet = java.sourceSets.findByName("main")!! | ||
|
||
fun DependencyHandlerScope.minecraft(): ExternalModuleDependency = | ||
create( | ||
group = "net.minecraftforge", | ||
name = "forge", | ||
version = "${minecraftVersion}-${forgeVersion}" | ||
).apply { add("minecraft", this) } | ||
|
||
group = "de.nekeras" | ||
version = "${minecraftVersion}-${modVersion}" | ||
|
||
java.sourceCompatibility = JavaVersion.VERSION_1_8 | ||
java.targetCompatibility = JavaVersion.VERSION_1_8 | ||
|
||
tasks.withType<JavaCompile> { | ||
sourceCompatibility = JavaVersion.VERSION_1_8.toString() | ||
targetCompatibility = JavaVersion.VERSION_1_8.toString() | ||
} | ||
version = "$minecraftVersion-$modVersion" | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
minecraft() | ||
minecraft(group = "net.minecraftforge", name = "forge", version = "$minecraftVersion-$forgeVersion") | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
|
||
configure<MinecraftExtension> { | ||
minecraft { | ||
mappings("official", minecraftVersion) | ||
|
||
runs { | ||
"client" { | ||
workingDirectory(project.file("run")) | ||
val client by runs.creating { | ||
workingDirectory(project.file("run")) | ||
|
||
property("forge.logging.markers", "SCAN,REGISTRIES,REGISTRYDUMP") | ||
property("forge.logging.console.level", "debug") | ||
property("forge.logging.markers", "SCAN,REGISTRIES,REGISTRYDUMP") | ||
property("forge.logging.console.level", "debug") | ||
|
||
mods { | ||
"borderless" { | ||
source(mainSourceSet) | ||
} | ||
} | ||
val borderless by mods.creating { | ||
source(sourceSets.main.get()) | ||
} | ||
} | ||
} | ||
|
||
tasks.withType<Jar> { | ||
manifest { | ||
attributes( | ||
mapOf( | ||
"Specification-Title" to project.name, | ||
"Specification-Vendor" to "Nekeras", | ||
"Specification-Version" to project.version, | ||
"Implementation-Title" to project.name, | ||
"Implementation-Version" to project.version, | ||
"Implementation-Vendor" to "Nekeras", | ||
"Implementation-Timestamp" to DateTimeFormatter | ||
.ofPattern("yyyy-MM-dd'T'HH:mm:ssZ") | ||
.withZone(ZoneId.systemDefault()) | ||
.format(Instant.now()) | ||
) | ||
) | ||
} | ||
} | ||
|
||
val forceModsTomlRefresh = tasks.register("forceModsTomlRefresh", Delete::class.java) { | ||
delete(File(mainSourceSet.output.resourcesDir, "/META-INF/mods.toml")) | ||
}.get() | ||
val server by runs.creating { | ||
workingDirectory(project.file("run")) | ||
|
||
tasks.withType<ProcessResources> { | ||
dependsOn(forceModsTomlRefresh) | ||
property("forge.logging.markers", "SCAN,REGISTRIES,REGISTRYDUMP") | ||
property("forge.logging.console.level", "debug") | ||
|
||
from(mainSourceSet.resources.srcDirs) { | ||
include("META-INF/mods.toml") | ||
expand( | ||
mapOf( | ||
"version" to project.version, | ||
"forge_version_major" to forgeVersion.split(".")[0] | ||
) | ||
) | ||
val borderless by mods.creating { | ||
source(sourceSets.main.get()) | ||
} | ||
} | ||
} | ||
|
||
tasks.withType<Javadoc> { | ||
source(mainSourceSet.allJava) | ||
tasks.processResources { | ||
from(sourceSets.main.get().resources.srcDirs) { | ||
duplicatesStrategy = DuplicatesStrategy.INCLUDE | ||
include("META-INF/mods.toml") | ||
expand("version" to project.version) | ||
} | ||
} | ||
|
||
val sourcesJar = tasks.register("sourcesJar", Jar::class.java) { | ||
classifier = "sources" | ||
from(mainSourceSet.allJava) | ||
}.get() | ||
|
||
val javadocJar = tasks.register("javadocJar", Jar::class.java) { | ||
classifier = "javadoc" | ||
from(tasks.getByName("javadoc")) | ||
}.get() | ||
|
||
publishing { | ||
publications { | ||
create<MavenPublication>("maven") { | ||
from(components["java"]) | ||
artifact(sourcesJar) | ||
artifact(javadocJar) | ||
} | ||
tasks.jar { | ||
manifest { | ||
attributes( | ||
"Specification-Title" to project.name, | ||
"Specification-Vendor" to "Nekeras", | ||
"Specification-Version" to project.version, | ||
"Implementation-Title" to project.name, | ||
"Implementation-Version" to project.version, | ||
"Implementation-Vendor" to "Nekeras" | ||
) | ||
} | ||
} | ||
|
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
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
This file was deleted.
Oops, something went wrong.
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,14 @@ | ||
pluginManagement { | ||
repositories { | ||
maven("https://maven.minecraftforge.net") | ||
} | ||
resolutionStrategy { | ||
eachPlugin { | ||
when (requested.id.id) { | ||
"net.minecraftforge.gradle" -> useModule("net.minecraftforge.gradle:ForgeGradle:5.1.+") | ||
} | ||
} | ||
} | ||
} | ||
|
||
rootProject.name = "BorderlessWindow" |
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
90 changes: 0 additions & 90 deletions
90
src/main/java/de/nekeras/borderless/FullscreenModeHolder.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.