Skip to content

Commit

Permalink
GitHub username change: joel-jeremy (#80)
Browse files Browse the repository at this point in the history
* GitHub username change: joel-jeremy

* Update version from alpha to beta

* Update group ID and artifact IDs

* Update gradle rootProject.name

* Set rootProject.name as sonar.projectName and rootProject.group as sonar.projectKey

* Add sonarcloud coverage badge

* Discord badge
  • Loading branch information
joel-jeremy committed Oct 15, 2022
1 parent ef7d267 commit e2089a6
Show file tree
Hide file tree
Showing 241 changed files with 1,671 additions and 1,638 deletions.
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Each `@Nested` test class must test scenarios that is supported by the method it
- Use `@DisplayName` to describe the scenario being tested by the `@Test` method e.g. `@DisplayName("should throw when x argument is null)`.

```java
// Class under test: io.github.joeljeremy7.externalizedproperties.resolver.my.MyResolver
// Class under test: io.github.joeljeremy.externalizedproperties.resolvers.my.MyResolver
class MyResolver implements Resolver {
public MyResolver(...) {
...
Expand All @@ -91,7 +91,7 @@ Each `@Nested` test class must test scenarios that is supported by the method it
}
}

// Test class: io.github.joeljeremy7.externalizedproperties.resolver.my.MyResolverTests
// Test class: io.github.joeljeremy.externalizedproperties.resolvers.my.MyResolverTests
class MyResolverTests {
@Nested
class Constructors {
Expand Down Expand Up @@ -129,5 +129,5 @@ When releasing, the following steps must be followed:
1. Create a release and tag via GitHub Releases e.g. `1.0.0`.
- The release description should include a changelog.
2. After release pipeline completes, bump up the version in root `build.gradle` to the next development version by creating a pull request.
- By default, the next development version is a minor version bump i.e. `1.0.0` --> `1.1.0`.
- By default, the next development version is a minor version bump i.e. `1.0.0` --> `1.1.0`. In case of pre-release versions (alpha, beta, etc.), bump according to semver guidelines i.e. `1.0.0-alpha` --> `1.0.0.alpha.1`.
3. Merge the pull request to `main`.
67 changes: 34 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# Externalized Properties

[![Gradle Build](https://github.com/joeljeremy7/externalized-properties/actions/workflows/gradle-build.yaml/badge.svg)](https://github.com/joeljeremy7/externalized-properties/actions/workflows/gradle-build.yaml)
[![CodeQL](https://github.com/joeljeremy7/externalized-properties/actions/workflows/codeql.yaml/badge.svg)](https://github.com/joeljeremy7/externalized-properties/actions/workflows/codeql.yaml)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.joeljeremy7.externalizedproperties/core/badge.svg)](https://search.maven.org/search?q=g:%22io.github.joeljeremy7.externalizedproperties%22)
[![Coverage Status](https://coveralls.io/repos/github/joeljeremy7/externalized-properties/badge.svg?branch=main)](https://coveralls.io/github/joeljeremy7/externalized-properties?branch=main)
[![Known Vulnerabilities](https://snyk.io/test/github/joeljeremy7/externalized-properties/badge.svg)](https://snyk.io/test/github/joeljeremy7/externalized-properties)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://github.com/joeljeremy7/externalized-properties/blob/main/LICENSE)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=io.github.joeljeremy7.externalizedproperties&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=io.github.joeljeremy7.externalizedproperties)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=io.github.joeljeremy7.externalizedproperties&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=io.github.joeljeremy7.externalizedproperties)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=io.github.joeljeremy7.externalizedproperties&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=io.github.joeljeremy7.externalizedproperties)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=io.github.joeljeremy7.externalizedproperties&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=io.github.joeljeremy7.externalizedproperties)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=io.github.joeljeremy7.externalizedproperties&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=io.github.joeljeremy7.externalizedproperties)
[![Discord](https://img.shields.io/discord/984438350054322206.svg?logo=discord&logoColor=white&logoWidth=20&labelColor=7289DA&label=Discord&color=17cf48)](https://discord.gg/sST9hEAF)
[![Gradle Build](https://github.com/joel-jeremy/externalized-properties/actions/workflows/gradle-build.yaml/badge.svg)](https://github.com/joel-jeremy/externalized-properties/actions/workflows/gradle-build.yaml)
[![CodeQL](https://github.com/joel-jeremy/externalized-properties/actions/workflows/codeql.yaml/badge.svg)](https://github.com/joel-jeremy/externalized-properties/actions/workflows/codeql.yaml)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.joel-jeremy.externalized-properties/core/badge.svg)](https://search.maven.org/search?q=g:%22io.github.joel-jeremy.externalized-properties%22)
[![Coverage Status](https://coveralls.io/repos/github/joel-jeremy/externalized-properties/badge.svg?branch=main)](https://coveralls.io/github/joel-jeremy/externalized-properties?branch=main)
[![Known Vulnerabilities](https://snyk.io/test/github/joel-jeremy/externalized-properties/badge.svg)](https://snyk.io/test/github/joel-jeremy/externalized-properties)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://github.com/joel-jeremy/externalized-properties/blob/main/LICENSE)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=io.github.joel-jeremy.externalized-properties&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=io.github.joel-jeremy.externalized-properties)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=io.github.joel-jeremy.externalized-properties&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=io.github.joel-jeremy.externalized-properties)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=io.github.joel-jeremy.externalized-properties&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=io.github.joel-jeremy.externalized-properties)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=io.github.joel-jeremy.externalized-properties&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=io.github.joel-jeremy.externalized-properties)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=io.github.joel-jeremy.externalized-properties&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=io.github.joel-jeremy.externalized-properties)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=io.github.joel-jeremy.externalized-properties&metric=coverage)](https://sonarcloud.io/summary/new_code?id=io.github.joel-jeremy.externalized-properties)
[![Discord](https://img.shields.io/discord/1025648239162175578.svg?logo=discord&logoColor=white&logoWidth=20&labelColor=7289DA&label=Discord&color=17cf48)](https://discord.gg/SVfahQGMmx)

A lightweight and extensible library to resolve application properties from various external sources.

Expand All @@ -26,29 +27,29 @@ The goal of this library is to make it easy for applications to implement config
### Gradle

```groovy
implementation "io.github.joeljeremy7.externalizedproperties:core:${version}"
implementation "io.github.joel-jeremy.externalized-properties:externalized-properties-core:${version}"
// Optional/additional resolvers
implementation "io.github.joeljeremy7.externalizedproperties:resolvers-database:${version}"
implementation "io.github.joeljeremy7.externalizedproperties:resolvers-git:${version}"
implementation "io.github.joel-jeremy.externalized-properties:externalized-properties-database:${version}"
implementation "io.github.joel-jeremy.externalized-properties:externalized-properties-git:${version}"
```

### Maven

```xml
<dependency>
<groupId>io.github.joeljeremy7.externalizedproperties</groupId>
<artifactId>core</artifactId>
<groupId>io.github.joel-jeremy.externalized-properties</groupId>
<artifactId>externalized-properties-core</artifactId>
<version>${version}</version>
</dependency>
<!-- Optional/additional resolvers -->
<dependency>
<groupId>io.github.joeljeremy7.externalizedproperties</groupId>
<artifactId>resolvers-database</artifactId>
<groupId>io.github.joel-jeremy.externalized-properties</groupId>
<artifactId>externalized-properties-database</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>io.github.joeljeremy7.externalizedproperties</groupId>
<artifactId>resolvers-git</artifactId>
<groupId>io.github.joel-jeremy.externalized-properties</groupId>
<artifactId>externalized-properties-git</artifactId>
<version>${version}</version>
</dependency>
```
Expand All @@ -57,17 +58,17 @@ implementation "io.github.joeljeremy7.externalizedproperties:resolvers-git:${ver

Externalized Properties jars are published with Automatic-Module-Name manifest attribute:

- Core - `io.github.joeljeremy7.externalizedproperties.core`
- Database Resolver - `io.github.joeljeremy7.externalizedproperties.resolvers.database`
- Git Resolver - `io.github.joeljeremy7.externalizedproperties.resolvers.git`
- Core - `io.github.joeljeremy.externalizedproperties.core`
- Database Resolver - `io.github.joeljeremy.externalizedproperties.database`
- Git Resolver - `io.github.joeljeremy.externalizedproperties.git`

Module authors can use above module names in their module-info.java:

```java
module foo.bar {
requires io.github.joeljeremy7.externalizedproperties.core;
requires io.github.joeljeremy7.externalizedproperties.resolvers.database;
requires io.github.joeljeremy7.externalizedproperties.resolvers.git;
requires io.github.joeljeremy.externalizedproperties.core;
requires io.github.joeljeremy.externalizedproperties.database;
requires io.github.joeljeremy.externalizedproperties.git;
}
```

Expand All @@ -78,10 +79,10 @@ Externalized Properties takes full advantage of Java's [Dynamic Proxies](https:/
### ✔️ Property Resolution

- [Map Properties to Dynamic Proxy Interface Methods](docs/property-resolution.md#-map-properties-to-dynamic-proxy-interface-methods)
- via [@ExternalizedProperty](core/src/main/java/io/github/joeljeremy7/externalizedproperties/core/ExternalizedProperty.java)
- via [@ExternalizedProperty](core/src/main/java/io/github/joeljeremy/externalizedproperties/core/ExternalizedProperty.java)
- [Default/Fallback Values](docs/property-resolution.md#-defaultfallback-values)
- [Support for Property Names Known at Runtime](docs/property-resolution.md#-support-for-property-names-known-at-runtime)
- via [@ResolverFacade](core/src/main/java/io/github/joeljeremy7/externalizedproperties/core/ResolverFacade.java)
- via [@ResolverFacade](core/src/main/java/io/github/joeljeremy/externalizedproperties/core/ResolverFacade.java)
- [Support for Various Configuration File/Resource Formats](docs/property-resolution.md#-support-for-various-configuration-fileresource-formats)
- [Caching](docs/property-resolution.md#-caching)
- [Eager Loading](docs/property-resolution.md#-eager-loading)
Expand All @@ -92,15 +93,15 @@ Externalized Properties takes full advantage of Java's [Dynamic Proxies](https:/
- [Automatic Property Conversion](docs/conversion.md#-automatic-property-conversion)
- [Conversion to Generic Types](docs/conversion.md#-conversion-to-generic-types)
- [Conversion of Arbitrary Values](docs/conversion.md#-conversion-of-arbitrary-values)
- via [@ConverterFacade](core/src/main/java/io/github/joeljeremy7/externalizedproperties/core/ConverterFacade.java)
- via [@ConverterFacade](core/src/main/java/io/github/joeljeremy/externalizedproperties/core/ConverterFacade.java)
- [Custom Converters](docs/conversion.md#-custom-converters)

### ✔️ Variable Expansion

- [Automatic Variable Expansion in Property Names](docs/variable-expansion.md#-automatic-variable-expansion-in-property-names)
- [Automatic Variable Expansion in Properties](docs/variable-expansion.md#-automatic-variable-expansion-in-properties)
- [Variable Expansion in Arbitrary Values](docs/variable-expansion.md#-variable-expansion-in-arbitrary-values)
- via [@VariableExpanderFacade](core/src/main/java/io/github/joeljeremy7/externalizedproperties/core/VariableExpanderFacade.java)
- via [@VariableExpanderFacade](core/src/main/java/io/github/joeljeremy/externalizedproperties/core/VariableExpanderFacade.java)

### ✔️ Processing

Expand All @@ -118,7 +119,7 @@ Externalized Properties takes full advantage of Java's [Dynamic Proxies](https:/

## 🏎️ Quick Start

Properties are mapped to proxy interface methods by using the [@ExternalizedProperty](core/src/main/java/io/github/joeljeremy7/externalizedproperties/core/ExternalizedProperty.java) annotation.
Properties are mapped to proxy interface methods by using the [@ExternalizedProperty](core/src/main/java/io/github/joeljeremy/externalizedproperties/core/ExternalizedProperty.java) annotation.

(For more advanced scenarios, please see the feature documentations.)

Expand Down Expand Up @@ -166,4 +167,4 @@ private static ExternalizedProperties buildExternalizedProperties() {

## 🧪 Samples

More sample can be found here: <https://github.com/joeljeremy7/externalized-properties-samples>
More sample can be found here: <https://github.com/joel-jeremy/externalized-properties-samples>
26 changes: 12 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ apply from: "${rootDir}/gradle/dependency-updates.gradle"
allprojects {
apply from: "${rootDir}/gradle/dependency-versions.gradle"

group = "io.github.joeljeremy7.externalizedproperties"
group = "io.github.joel-jeremy.externalized-properties"

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

repositories {
mavenLocal()
Expand Down Expand Up @@ -54,13 +54,11 @@ configure(javaProjects) {
}
}
suites.configureEach {
useJUnitJupiter("${versions.junitJupiter}")
useJUnitJupiter("${versions.junitJupiter}")
}
}

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

toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
Expand All @@ -83,14 +81,14 @@ configure(javaProjects) {
}

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")
}
}
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")
}
}
}
}

This file was deleted.

10 changes: 5 additions & 5 deletions docs/conversion.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ By enabling the default converters, you get out-of-the-box conversion support fo

## 🌟 Automatic Property Conversion

Externalized Properties automatically attempts to convert resolved properties to the declared proxy method (non-String) return type. The library will handle the conversion behind the scenes - using the registered [Converter](../core/src/main/java/io/github/joeljeremy7/externalizedproperties/core/Converter.java)s e.g.
Externalized Properties automatically attempts to convert resolved properties to the declared proxy method (non-String) return type. The library will handle the conversion behind the scenes - using the registered [Converter](../core/src/main/java/io/github/joeljeremy/externalizedproperties/core/Converter.java)s e.g.

```java
public interface ApplicationProperties {
Expand Down Expand Up @@ -71,9 +71,9 @@ Each item in the list will be converted to an `Optional<Integer>`.

## 🌟 Conversion of Arbitrary Values

Externalized Properties has support for conversion of arbitrary String values to other types. This is made possible by the [@ConverterFacade](../core/src/main/java/io/github/joeljeremy7/externalizedproperties/core/ConverterFacade.java) annotation e.g.
Externalized Properties has support for conversion of arbitrary String values to other types. This is made possible by the [@ConverterFacade](../core/src/main/java/io/github/joeljeremy/externalizedproperties/core/ConverterFacade.java) annotation e.g.

(Kindly see [@ConverterFacade](../core/src/main/java/io/github/joeljeremy7/externalizedproperties/core/ConverterFacade.java) documentation to learn more about the rules of defining a converter facade.)
(Kindly see [@ConverterFacade](../core/src/main/java/io/github/joeljeremy/externalizedproperties/core/ConverterFacade.java) documentation to learn more about the rules of defining a converter facade.)

```java
public interface ProxyInterface {
Expand All @@ -84,11 +84,11 @@ public interface ProxyInterface {
}
```

Invoking the methods annotated with [@ConverterFacade](../core/src/main/java/io/github/joeljeremy7/externalizedproperties/core/ConverterFacade.java) will delegate the arguments to the registered [Converter](../core/src/main/java/io/github/joeljeremy7/externalizedproperties/core/Converter.java)s to do the conversion. The converted value will be returned by the method.
Invoking the methods annotated with [@ConverterFacade](../core/src/main/java/io/github/joeljeremy/externalizedproperties/core/ConverterFacade.java) will delegate the arguments to the registered [Converter](../core/src/main/java/io/github/joeljeremy/externalizedproperties/core/Converter.java)s to do the conversion. The converted value will be returned by the method.

## 🚀 Custom Converters

There are several built-in converters but it is very easy to create a custom converter by implementing the [Converter](../core/src/main/java/io/github/joeljeremy7/externalizedproperties/core/Converter.java) interface and registering the converter via the [ExternalizedProperties](../core/src/main/java/io/github/joeljeremy7/externalizedproperties/core/ExternalizedProperties.java) builder.
There are several built-in converters but it is very easy to create a custom converter by implementing the [Converter](../core/src/main/java/io/github/joeljeremy/externalizedproperties/core/Converter.java) interface and registering the converter via the [ExternalizedProperties](../core/src/main/java/io/github/joeljeremy/externalizedproperties/core/ExternalizedProperties.java) builder.

```java
public class MyCustomConverter implements Converter<MyCustomType> {
Expand Down

0 comments on commit e2089a6

Please sign in to comment.