mirror of
https://github.com/neoforged/NeoForge.git
synced 2025-12-10 00:22:25 -06:00
Co-authored-by: Matyrobbrt <matyrobbrt@gmail.com> Co-authored-by: Sebastian Hartte <shartte@users.noreply.github.com> Co-authored-by: Technici4n <13494793+Technici4n@users.noreply.github.com> Co-authored-by: TelepathicGrunt <40846040+TelepathicGrunt@users.noreply.github.com> Co-authored-by: XFactHD <xfacthd@gmx.de>
80 lines
2.0 KiB
Groovy
80 lines
2.0 KiB
Groovy
plugins {
|
|
id 'java'
|
|
id 'maven-publish'
|
|
id 'net.neoforged.licenser'
|
|
id 'neoforge.formatting-conventions'
|
|
}
|
|
|
|
java.withSourcesJar()
|
|
|
|
apply plugin : net.neoforged.minecraftdependencies.MinecraftDependenciesPlugin
|
|
|
|
dependencies {
|
|
compileOnly(project(path: ':neoforge')) {
|
|
capabilities {
|
|
requireFeature('client')
|
|
}
|
|
}
|
|
|
|
compileOnly(platform("org.junit:junit-bom:${project.jupiter_api_version}"))
|
|
compileOnly "org.junit.jupiter:junit-jupiter-params"
|
|
|
|
compileOnly "org.jetbrains:annotations:${project.jetbrains_annotations_version}"
|
|
}
|
|
|
|
license {
|
|
header = rootProject.file('codeformat/HEADER.txt')
|
|
include '**/*.java'
|
|
}
|
|
|
|
tasks.withType(JavaCompile).configureEach {
|
|
options.encoding = 'UTF-8'
|
|
}
|
|
|
|
def version = project.version
|
|
tasks.withType(ProcessResources).configureEach {
|
|
inputs.properties version: version
|
|
|
|
filesMatching(['META-INF/neoforge.mods.toml']) {
|
|
expand file: [
|
|
jarVersion: version
|
|
]
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
publications.create('TestFramework', MavenPublication) {
|
|
groupId = project.group
|
|
artifactId = project.name
|
|
version = project.version
|
|
|
|
from components.java
|
|
}
|
|
repositories {
|
|
maven rootProject.gradleutils.getPublishingMaven()
|
|
}
|
|
}
|
|
|
|
// Workaround for Eclipse discarding compileOnly cross-project dependencies.
|
|
// See also https://github.com/gradle/gradle/issues/32284
|
|
configurations {
|
|
eclipseCompileClasspath {
|
|
attributes {
|
|
// Needs to be jar otherwise it will get purged
|
|
attribute LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements, LibraryElements.JAR)
|
|
// To resolve apiElements specifically
|
|
attribute Usage.USAGE_ATTRIBUTE, objects.named(Usage, Usage.JAVA_API)
|
|
}
|
|
}
|
|
}
|
|
dependencies {
|
|
eclipseCompileClasspath project(path: ':neoforge')
|
|
}
|
|
plugins.withId("eclipse") {
|
|
eclipse {
|
|
classpath {
|
|
plusConfigurations.add(configurations.eclipseCompileClasspath)
|
|
}
|
|
}
|
|
}
|