Removed Utilties hard dependency. Fixed issue when custom build props are not available

This commit is contained in:
nathan 2018-08-27 23:10:23 +02:00
parent 5a956378b9
commit 1c6f10ff3b
2 changed files with 11 additions and 56 deletions

View File

@ -19,12 +19,18 @@ import java.time.Instant
buildscript {
// load properties from custom location
def propsFile = Paths.get("${projectDir}/../../gradle.properties").toAbsolutePath().normalize().toFile()
println("Loading custom property data from: ${propsFile}")
def propsFile = Paths.get("${projectDir}/../../gradle.properties").normalize().toFile()
if (propsFile.canRead()) {
println("Loading custom property data from: ${propsFile}")
def props = new Properties()
propsFile.withInputStream {props.load(it)}
props.each {key, val -> project.ext.set(key, val)}
def props = new Properties()
propsFile.withInputStream {props.load(it)}
props.each {key, val -> project.ext.set(key, val)}
}
else {
ext.sonatypeUsername = ""
ext.sonatypePassword = ""
}
// for plugin publishing and license sources
repositories {
@ -148,11 +154,6 @@ repositories {
dependencies {
implementation(project('Utilities')) {
// don't include any of the project dependencies for anything
transitive = false
}
// our main dependencies are ALSO the same as the limited utilities (they are not automatically pulled in from other sourceSets)
// needed by the utilities (custom since we don't want to include everything). IntelliJ includes everything, but our builds do not
api 'com.lmax:disruptor:3.4.2'
@ -180,42 +181,6 @@ tasks.withType(Jar) {
}
}
///////////////////////////////
////// UTILITIES COMPILE (for inclusion into jars)
///////////////////////////////
static String[] javaFile(String... fileNames) {
def fileList = [] as ArrayList
for (name in fileNames) {
def fixed = name.replace('.', '/') + '.java'
fileList.add(fixed)
}
return fileList
}
task compileUtils(type: JavaCompile) {
// we don't want the default include of **/*.java
getIncludes().clear()
source = Collections.singletonList('../Utilities/src')
include javaFile('dorkbox.util.FastThreadLocal')
classpath = sourceSets.main.compileClasspath
destinationDir = file("$rootDir/build/classes_utilities")
}
///////////////////////////////
////// Jar Tasks
///////////////////////////////
jar {
dependsOn compileUtils
// include applicable class files from subset of Utilities project
from compileUtils.destinationDir
}
/////////////////////////////
//// Maven Publishing + Release
/////////////////////////////

View File

@ -13,14 +13,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
include("Utilities")
for (project in rootProject.children) {
project.projectDir = file("../$project.name")
project.buildFileName = "build.gradle"
assert (project.projectDir.directory)
assert (project.buildFile.file)
}
enableFeaturePreview('STABLE_PUBLISHING')