Fix Gradle compilation.

This commit is contained in:
Adrian Siekierka 2021-11-27 08:26:37 +01:00
parent c09be6f465
commit 262ff7ee6d
4 changed files with 26 additions and 178 deletions

View file

@ -8,13 +8,23 @@ buildscript {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "a Russian forum post told me to use this to find the missing files"
url = "https://repo.spongepowered.org/repository/forge-proxy/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
url = "https://jitpack.io"
}
maven {
url = "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
classpath 'com.github.CDAGaming:ForgeGradle:1c670759c5'
}
}
@ -123,15 +133,15 @@ task sourceJar(type: Jar) {
}
// add api classes to javadoc
javadoc {
source += sourceSets.api.allSource
}
// javadoc {
// source += sourceSets.api.allSource
// }
// add a javadoc jar
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}
// task javadocJar(type: Jar, dependsOn: javadoc) {
// classifier = 'javadoc'
// from 'build/docs/javadoc'
// }
// because the normal output has been made to be obfuscated
task deobfJar(type: Jar) {
@ -249,160 +259,4 @@ checkstyle {
checkstyleApi.exclude 'cofh/**'
// make sure all of these happen when we run build
build.dependsOn sourceJar, javadocJar, deobfJar, apiJar
// --------------------
// maven section
// -------------------
// create the deployerJars dependency configuration
configurations {
deployerJars
sshAntTask
}
dependencies {
// dependency in deployerJars, for maven deployment. see definition in mavenDeployer{} below
deployerJars "org.apache.maven.wagon:wagon-ssh:2.2"
sshAntTask 'org.apache.ant:ant-jsch:1.9.6', 'com.jcraft:jsch:0.1.53'
}
clean{
delete "modules"
}
// specify artifacts to be uploaded
artifacts {
// the default jar is already here by default
archives sourceJar
archives javadocJar
archives deobfJar
archives apiJar
// Modules
archives coreJar
archives buildersJar
archives energyJar
archives factoryJar
archives siliconJar
archives transportJar
archives roboticsJar
}
def sftp(String subPath, Closure antFileset = {}) {
ant {
taskdef(name: 'scp', classname: 'org.apache.tools.ant.taskdefs.optional.ssh.Scp',
classpath: configurations.sshAntTask.asPath)
Map sftpArgs = [
verbose : 'yes',
todir : priv.username + "@" + priv.host + ":" + priv.remotedir + version + "/" + subPath,
port: priv.port,
password: priv.password,
sftp: true,
trust: 'yes'
]
delegate.scp(sftpArgs) {
antFileset.delegate = delegate
antFileset()
}
}
}
task upload(dependsOn: build) {
description = 'Update files on remote server.'
doFirst {
sftp("") {
fileset(dir: libsDir)
}
sftp("modules") {
fileset(dir: 'modules')
}
}
}
if (ext.priv == null)
upload.enabled = false;
uploadArchives {
// make sure this happens after reobfuscation
dependsOn 'reobf'
repositories {
if (project.hasProperty("filesmaven")) { // if this is the Forge server, and this stuff is defined...
logger.info('Publishing to files server')
mavenDeployer {
// specify the jars that maven needs to deploy here
configuration = configurations.deployerJars
// authentication, again, specially set in the forge server environment
repository(url: project.filesmaven.url) {
authentication(userName: project.filesmaven.username, privateKey: project.filesmaven.key)
}
// here you specify all your metadata
// this is the definition of the maven pom.xml. This is simply a DSL to define the XML. Not actual fields or things to set.
pom {
groupId = project.group
version = project.version
artifactId = project.archivesBaseName
project {
name project.archivesBaseName
packaging 'jar'
description 'A Minecraft mod adding all sorts of machinery'
url 'http://www.mod-buildcraft.com/'
scm {
url 'https://github.com/BuildCraft/BuildCraft'
connection 'scm:git:git://github.com/BuildCraft/BuildCraft.git'
developerConnection 'scm:git:git@github.com:BuildCraft/BuildCraft.git'
}
issueManagement {
system 'github'
url 'https://github.com/BuildCraft/BuildCraft/issues'
}
licenses {
license {
name 'Minecraft Mod Public License'
url 'http://www.mod-buildcraft.com/MMPL-1.0.txt'
distribution 'repo'
}
}
developers {
developer {
id 'SpaceToad'
name 'SpaceToad'
roles { role 'developer' }
}
developer {
id 'CovertJaguar'
name 'CovertJaguar'
roles { role 'developer' }
}
developer {
id 'SirSngir'
name 'SirSengir'
roles { role 'developer' }
}
developer {
id 'Krapht'
name 'Krapht'
roles { role 'developer' }
}
}
}
}
}
}
else
{
// otherwise publishing to the local repo in ~/.m2 is fine...
add project.repositories.mavenLocal()
}
}
}
build.dependsOn sourceJar, deobfJar, apiJar

View file

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip

View file

@ -9,13 +9,13 @@
Description: none
-->
<module name="Checker">
<property name="severity" value="error"/>
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
<property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
<property name="checkFormat" value="$1"/>
</module>
<property name="severity" value="warning"/>
<module name="TreeWalker">
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
<property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
<property name="checkFormat" value="$1"/>
</module>
<module name="MissingOverride"/>
<module name="RedundantImport"/>
<module name="UnusedImports"/>
@ -82,7 +82,6 @@
<module name="ArrayTypeStyle"/>
<module name="UpperEll"/>
<module name="OuterTypeFilename"/>
<module name="FileContentsHolder"/>
<module name="RegexpSinglelineJava">
<property name="format" value="System\.(out|err)\.print(ln|f){0,1}\(.*\)"/>
<property name="ignoreComments" value="true"/>

View file

@ -1,5 +0,0 @@
remotedir = /home/exemple/
host = thehost
port = 22
username = ****
password = ******