Added default() to set project defaults. Added defaultCompileOptions()
This commit is contained in:
parent
6b4916c8a8
commit
a7ddacf6d2
@ -295,6 +295,16 @@ open class StaticMethodsAndTools(private val project: Project) {
|
|||||||
return DependencyScanner.ProjectDependencies(projectDependencies, existingNames.map { it.value })
|
return DependencyScanner.ProjectDependencies(projectDependencies, existingNames.map { it.value })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set gradle project defaults, as used by dorkbox, llc
|
||||||
|
*/
|
||||||
|
fun defaults() {
|
||||||
|
fixIntellijPaths()
|
||||||
|
fixMavenPaths()
|
||||||
|
defaultResolutionStrategy()
|
||||||
|
defaultCompileOptions()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fix the compiled output from intellij to be SEPARATE from gradle.
|
* Fix the compiled output from intellij to be SEPARATE from gradle.
|
||||||
*/
|
*/
|
||||||
@ -404,6 +414,20 @@ open class StaticMethodsAndTools(private val project: Project) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Always compile java with UTF-8, make it incremental, and compile `package-info.java` classes
|
||||||
|
*/
|
||||||
|
fun defaultCompileOptions() {
|
||||||
|
project.allprojects.forEach { project ->
|
||||||
|
project.afterEvaluate { prj ->
|
||||||
|
prj.tasks.withType(JavaCompile::class.java) {
|
||||||
|
it.options.encoding = "UTF-8"
|
||||||
|
it.options.isIncremental = true
|
||||||
|
it.options.compilerArgs.add("-Xpkginfo:always")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Basic, default compile configurations
|
* Basic, default compile configurations
|
||||||
|
Loading…
Reference in New Issue
Block a user