Skip to content

Commit

Permalink
Builder API updates + gradle versions plugin (#30)
Browse files Browse the repository at this point in the history
* Builder API updates + gradle versions plugin

* Add resource format support docs

* Fix spacing

* Fix typo in docs

* ProfilesBuilder + builder arguments checks

* Variable expansion in resolved properties

* Cleanup

* Use test containers BOM

* Fix database resolver dependencies

* Use double quotes in gradle files

* Rename to enableVariableExpansionInProperties

* Cleanup

* Doc updates

* Doc updates

* Update javadoc
  • Loading branch information
joel-jeremy committed Jun 22, 2022
1 parent befc2a9 commit ffb8f50
Show file tree
Hide file tree
Showing 19 changed files with 527 additions and 147 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ module foo.bar {
✨ Proxy Interface Property Mapping (via [@ExternalizedProperty](core/src/main/java/io/github/joeljeremy7/externalizedproperties/core/ExternalizedProperty.java))
✨ Default/Fallback Values
✨ Non-Static/Dynamic Property Names (via [@ResolverFacade](core/src/main/java/io/github/joeljeremy7/externalizedproperties/core/ResolverFacade.java))
✨ Support for Various Configuration File/Resource Formats
✨ Caching
✨ Eager Loading
✨ Automatic Cache Reload
Expand All @@ -70,12 +71,13 @@ module foo.bar {

✨ Automatic Property Conversion
✨ Generic Type Conversion
Dynamic Value Conversion (via [@ConverterFacade](core/src/main/java/io/github/joeljeremy7/externalizedproperties/core/ConverterFacade.java))
Conversion of Arbitrary Values (via [@ConverterFacade](core/src/main/java/io/github/joeljeremy7/externalizedproperties/core/ConverterFacade.java))

### 🔗 [Variable Expansion](docs/variable-expansion.md)

✨ Automatic Variable Expansion in Property Names
✨ Dynamic Variable Expansion (via [@VariableExpanderFacade](core/src/main/java/io/github/joeljeremy7/externalizedproperties/core/VariableExpanderFacade.java))
✨ Automatic Variable Expansion in Properties
✨ Variable Expansion in Arbitrary Values (via [@VariableExpanderFacade](core/src/main/java/io/github/joeljeremy7/externalizedproperties/core/VariableExpanderFacade.java))

### 🔗 [Processing](docs/processing.md)

Expand Down
57 changes: 38 additions & 19 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
plugins {
id 'io.github.gradle-nexus.publish-plugin'
id 'com.github.kt3k.coveralls'
id 'io.snyk.gradle.plugin.snykplugin'
id 'org.sonarqube'
id 'me.champeau.jmh' apply false
id 'net.ltgt.errorprone' apply false
id 'net.ltgt.nullaway' apply false
id "io.github.gradle-nexus.publish-plugin"
id "com.github.kt3k.coveralls"
id "io.snyk.gradle.plugin.snykplugin"
id "org.sonarqube"
id "com.github.ben-manes.versions"
id "me.champeau.jmh" apply false
id "net.ltgt.errorprone" apply false
id "net.ltgt.nullaway" apply false
}

apply from: "${rootDir}/gradle/reporting.gradle"
Expand All @@ -16,10 +17,10 @@ apply from: "${rootDir}/gradle/sonarqube.gradle"
allprojects {
apply from: "${rootDir}/gradle/dependencies.gradle"

group = 'io.github.joeljeremy7.externalizedproperties'
group = "io.github.joeljeremy7.externalizedproperties"

def snapshotSuffix = rootProject.hasProperty('release') ? '' : '-SNAPSHOT'
version = '1.0.0-alpha.4' + snapshotSuffix
def snapshotSuffix = rootProject.hasProperty("release") ? "" : "-SNAPSHOT"
version = "1.0.0-alpha.4" + snapshotSuffix

repositories {
mavenLocal()
Expand All @@ -30,12 +31,16 @@ allprojects {
def javaProjects = subprojects.findAll { new File(it.projectDir, "src").exists() }

configure(javaProjects) {
apply plugin: 'java-library'
apply plugin: 'java-test-fixtures'
apply plugin: "java-library"
apply plugin: "java-test-fixtures"

apply from: "${rootDir}/gradle/publications.gradle"
apply from: "${rootDir}/gradle/code-quality.gradle"

dependencies {
testImplementation "org.junit.jupiter:junit-jupiter:${versions.junitJupiter}"
}

testing {
suites {
test {
Expand All @@ -55,7 +60,7 @@ configure(javaProjects) {
}

java {
archivesBaseName = rootProject.relativeProjectPath(project.path).replace(':', '-')
archivesBaseName = rootProject.relativeProjectPath(project.path).replace(":", "-")

toolchain {
languageVersion = JavaLanguageVersion.of(11)
Expand All @@ -69,23 +74,37 @@ configure(javaProjects) {
javadoc {
configure(options) {
tags(
'apiNote:a:API Note:',
'implSpec:a:Implementation Requirements:',
'implNote:a:Implementation Note:'
"apiNote:a:API Note:",
"implSpec:a:Implementation Requirements:",
"implNote:a:Implementation Note:"
)
}
}
}

if (project.hasProperty('ossrh')) {
if (project.hasProperty("ossrh")) {
nexusPublishing {
repositories {
sonatype {
nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
username = System.getenv('OSSRH_USERNAME') ?: property('ossrhUsername')
password = System.getenv('OSSRH_PASSWORD') ?: property('ossrhPassword')
username = System.getenv("OSSRH_USERNAME") ?: property("ossrhUsername")
password = System.getenv("OSSRH_PASSWORD") ?: property("ossrhPassword")
}
}
}
}

def isNonStable = { String version ->
def nonStableKeyword = ["PREVIEW","ALPHA","BETA", "SNAPSHOT"].any {
it -> version.toUpperCase().contains(it)
}
return nonStableKeyword
}
tasks.named("dependencyUpdates").configure {
rejectVersionIf {
isNonStable(it.candidate.version) && !isNonStable(it.currentVersion)
}
checkForGradleUpdate = true
outputFormatter = "html"
}
22 changes: 11 additions & 11 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
apply plugin: 'me.champeau.jmh'
apply plugin: "me.champeau.jmh"

description = 'Externalized Properties Core'
description = "Externalized Properties Core"

jar {
manifest {
attributes(
'Automatic-Module-Name': 'io.github.joeljeremy7.externalizedproperties.core'
"Automatic-Module-Name": "io.github.joeljeremy7.externalizedproperties.core"
)
}
}

dependencies {
// For testing different resource formats in ResourceResolver.
testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.13.3'
testImplementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.13.3'
testImplementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.13.3'
testImplementation "com.fasterxml.jackson.core:jackson-databind:2.13.3"
testImplementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.13.3"
testImplementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.13.3"
// For testing custom JCE providers with DecryptProcessor.JceDecryptor.
testImplementation 'org.bouncycastle:bcprov-jdk18on:1.71'
testImplementation "org.bouncycastle:bcprov-jdk18on:1.71"
}

jmh {
jmhVersion = '1.35'
// includes = ['ResolutionBenchmarks', 'ConversionBenchmarks', 'VariableExpansionBenchmarks']
jmhVersion = "1.35"
// includes = ["ResolutionBenchmarks", "ConversionBenchmarks", "VariableExpansionBenchmarks"]
humanOutputFile = project.file("${project.buildDir}/reports/jmh/human.txt")
resultsFile = project.file("${project.buildDir}/reports/jmh/results.json")
resultFormat = 'JSON'
jvmArgs = [ '-Xmx2G' ]
resultFormat = "JSON"
jvmArgs = [ "-Xmx2G" ]
}

0 comments on commit ffb8f50

Please sign in to comment.