Added Code to build-script that would support local bclib in IntelliJ (disabled in settings.gradle)
This commit is contained in:
parent
8bea55a8d2
commit
79aa3397f6
2 changed files with 45 additions and 1 deletions
|
@ -17,6 +17,7 @@ targetCompatibility = JavaVersion.VERSION_16
|
|||
archivesBaseName = project.archives_base_name
|
||||
version = project.mod_version
|
||||
group = project.maven_group
|
||||
def local_bclib = findProject(':BCLib') != null
|
||||
|
||||
repositories {
|
||||
maven { url "https://maven.dblsaiko.net/" }
|
||||
|
@ -33,7 +34,13 @@ dependencies {
|
|||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
||||
|
||||
useApi "vazkii.patchouli:Patchouli:1.17-${project.patchouli_version}"
|
||||
println "Using local BCLib: ${local_bclib}"
|
||||
if (local_bclib){
|
||||
compileOnly(project(":BCLib"))
|
||||
modRuntimeMapped(project(":BCLib"))
|
||||
} else {
|
||||
useApi "com.github.paulevsGitch:BCLib:${project.bclib_version}"
|
||||
}
|
||||
|
||||
useOptional "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}"
|
||||
useOptional "me.shedaniel:RoughlyEnoughItems-api-fabric:${project.rei_version}"
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
pluginManagement {
|
||||
repositories {
|
||||
jcenter()
|
||||
maven {
|
||||
name = 'Fabric'
|
||||
url = 'https://maven.fabricmc.net/'
|
||||
|
@ -7,3 +8,39 @@ pluginManagement {
|
|||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
// #### Custom Settings ####
|
||||
|
||||
//Change the next line to disable local BCLib loading
|
||||
def allowLocalLibUse = false
|
||||
|
||||
//When true, the local BCLib is also used in commandline builds
|
||||
def allowLocalLibInConsoleMode = false
|
||||
|
||||
//The path were to look for the local BCLib
|
||||
def BCLibPath = '../BCLib'
|
||||
|
||||
|
||||
// #### Logic ####
|
||||
def isIDE = properties.containsKey('android.injected.invoked.from.ide')
|
||||
|| (System.getenv("XPC_SERVICE_NAME") ?: "").contains("intellij")
|
||||
|| (System.getenv("XPC_SERVICE_NAME") ?: "").contains(".idea")
|
||||
|| System.getenv("IDEA_INITIAL_DIRECTORY") != null
|
||||
|
||||
println "IntelliJ: ${isIDE}"
|
||||
|
||||
def BCLibFolder = new File( BCLibPath )
|
||||
if( allowLocalLibUse && (isIDE || allowLocalLibInConsoleMode) && BCLibFolder.exists() ) {
|
||||
println "Using local BCLib from '${BCLibFolder}' in IntelliJ"
|
||||
println "If you do not want to load the local version of BClib"
|
||||
println "either rename the Folder containing BCLib to something"
|
||||
println "else, or set 'allowLocalLibUse' in settings.gradle"
|
||||
println "to false."
|
||||
println ""
|
||||
println "If you receive version-errors when launching minecraft"
|
||||
println "in IntelliJ, make sure you have set up gradle instead"
|
||||
println "of IntelliJ to compile and run."
|
||||
|
||||
include ':BCLib'
|
||||
project(":BCLib").projectDir = BCLibFolder
|
||||
project(':BCLib').buildFileName = './bclib-composit.gradle'
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue