-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add `FeatureFlag` structure to generate Flag transfer objects. They are based on [golang flag pgk](https://golang.org/pkg/flag/) - Add `FeatureFlagProvider` contract that will decide if a given feature is enabled / disabled. - Add missing concept, which will abide the default feature behavior. A missing feature is still enabled or disabled, it simply wasn't found at the provider and was a default value. - Add priority provider, which groups providers based on a comparator priority - Add safe copy to providers in priority provider to avoid runtime changes - Add creational methods to easily construct results - Add functional scopes for reacting to an enabled / disabled / missing result - Make functional scopes inline - Use contracts API to ensure only one time it will be called a scope - Add testapp with code samples - Add dokka for javadoc - Add publishing plugins to bintray and maven central - Add SCA tools (detekt / ktlint)
- Loading branch information
1 parent
40e510f
commit 6f97b41
Showing
7 changed files
with
170 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Module feature-flags | ||
|
||
A Feature Toggle (aka Feature Flags) Kotlin implementation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
apply plugin: 'com.jfrog.bintray' | ||
|
||
def getBintrayUsername() { | ||
return properties.get('bintrayUsername', System.getenv('BINTRAY_USERNAME')) | ||
} | ||
|
||
def getBintrayApiKey() { | ||
return properties.get('bintrayApiKey', System.getenv('BINTRAY_KEY')) | ||
} | ||
|
||
def getBintrayGpgPassword() { | ||
return properties.get('bintrayGpgPassword', System.getenv('BINTRAY_GPG_PASSWORD')) | ||
} | ||
|
||
def getMavenCentralUsername() { | ||
return properties.get('mavenCentralUsername', System.getenv('MAVEN_CENTRAL_USERNAME')) | ||
} | ||
|
||
def getMavenCentralPassword() { | ||
return properties.get('mavenCentralPassword', System.getenv('MAVEN_CENTRAL_PASSWORD')) | ||
} | ||
|
||
def shouldSyncWithMavenCentral() { | ||
return properties.get('syncWithMavenCentral', false) | ||
} | ||
|
||
def dryRunOnly() { | ||
return properties.get('dryRun', false) | ||
} | ||
|
||
bintray { | ||
user = getBintrayUsername() | ||
key = getBintrayApiKey() | ||
publications = ['mavenPublication'] | ||
|
||
pkg { | ||
repo = bintrayRepo | ||
userOrg = bintrayUserOrg | ||
licenses = licenseShortName | ||
name = bintrayName | ||
desc = bintrayDescription | ||
websiteUrl = projectUrl | ||
issueTrackerUrl = issuesUrl | ||
vcsUrl = scmUrl | ||
dryRun = dryRunOnly() | ||
override = true | ||
publish = true | ||
publicDownloadNumbers = true | ||
version { | ||
desc = bintrayDescription | ||
gpg { | ||
sign = false | ||
passphrase = getBintrayGpgPassword() | ||
} | ||
mavenCentralSync { | ||
sync = shouldSyncWithMavenCentral() | ||
user = getMavenCentralUsername() | ||
password = getMavenCentralPassword() | ||
close = '1' | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
apply plugin: 'maven-publish' | ||
|
||
group = 'com.saantiaguilera.featureflags' | ||
version = '0.0.1' | ||
|
||
ext { | ||
bintrayRepo = 'maven' | ||
bintrayUserOrg = 'saantiaguilera' | ||
bintrayName = "$group:$name" | ||
bintrayDescription = "Feature Toggles (often also referred to as Feature Flags) Kotlin implementation" | ||
projectUrl = 'https://github.com/saantiaguilera/feature-flags' | ||
issuesUrl = 'https://github.com/saantiaguilera/feature-flags/issues' | ||
scmUrl = 'https://github.com/saantiaguilera/feature-flags.git' | ||
scmConnection = 'scm:git:https://github.com/saantiaguilera/feature-flags.git' | ||
scmDeveloperConnection = 'scm:git:[email protected]:saantiaguilera/feature-flags.git' | ||
|
||
publishedGroupId = group | ||
libraryName = name | ||
artifact = name | ||
|
||
developerId = 'saantiaguilera' | ||
developerName = 'saantiaguilera' | ||
|
||
licenseShortName = 'GNU-3.0' | ||
} | ||
|
||
task sourcesJar(type: Jar, dependsOn: classes) { | ||
classifier = 'sources' | ||
from sourceSets.main.allSource | ||
} | ||
|
||
javadoc.failOnError = false | ||
task javadocJar(type: Jar, dependsOn: javadoc) { | ||
classifier = 'javadoc' | ||
from javadoc.destinationDir | ||
} | ||
|
||
artifacts { | ||
archives sourcesJar | ||
archives javadocJar | ||
} | ||
|
||
def pomConfig = { | ||
licenses { | ||
license { | ||
name 'The GNU General Public License v3.0' | ||
url 'https://www.gnu.org/licenses/gpl-3.0.html' | ||
distribution 'repo' | ||
} | ||
} | ||
developers { | ||
developer { | ||
id developerId | ||
name developerName | ||
} | ||
} | ||
|
||
scm { | ||
url scmUrl | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenPublication(MavenPublication) { | ||
from components.java | ||
artifact sourcesJar { | ||
classifier "sources" | ||
} | ||
artifact javadocJar { | ||
classifier "javadoc" | ||
} | ||
groupId project.group | ||
artifactId project.name | ||
version project.version | ||
pom.withXml { | ||
def root = asNode() | ||
root.appendNode('description', project.bintrayDescription) | ||
root.appendNode('name', project.name) | ||
root.appendNode('url', project.projectUrl) | ||
root.children().last() + pomConfig | ||
} | ||
} | ||
} | ||
} | ||
|
||
apply from: 'bintray.gradle' |