-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial Comit * Remove Epirus only functionality * Further refactoring * Spotless * Bumped Web3j project Version. Removed login Token from web3j config * Made printing more flexible * Changed Open Api on success text. Spotless. * Bumped web3j version for generated projects. Applied feedback. Removed docker functionality, it is now in epirus. * Removed Docker text Spotless. * final commit.
- Loading branch information
1 parent
686bcfc
commit c8aac7d
Showing
186 changed files
with
7,383 additions
and
2,600 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 |
---|---|---|
@@ -1 +1,2 @@ | ||
version=4.6.0-SNAPSHOT | ||
version=4.8.2-SNAPSHOT | ||
group=org.web3j.console |
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,91 @@ | ||
apply plugin: 'maven-publish' | ||
apply plugin: 'signing' | ||
apply plugin: "de.marcphilipp.nexus-publish" | ||
|
||
task javadocsJar(type: Jar) { | ||
archiveClassifier = 'javadoc' | ||
from javadoc | ||
} | ||
|
||
task sourcesJar(type: Jar) { | ||
archiveClassifier = 'sources' | ||
from sourceSets.main.allSource | ||
} | ||
|
||
task testsJar(type: Jar) { | ||
archiveClassifier = 'tests' | ||
from sourceSets.test.output | ||
} | ||
|
||
javadoc { options.encoding = 'UTF-8' } | ||
|
||
artifacts { archives sourcesJar, javadocsJar, testsJar } | ||
|
||
publishing { | ||
publications { | ||
maven(MavenPublication) { | ||
from components.java | ||
|
||
artifact sourcesJar | ||
artifact javadocsJar | ||
artifact testsJar | ||
|
||
pom { | ||
name = project.name | ||
description.set(project.provider({ project.description })) | ||
url = 'https://web3j.io' | ||
|
||
licenses { | ||
license { | ||
name = 'The Apache License, Version 2.0' | ||
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
} | ||
} | ||
|
||
scm { | ||
def slug = rootProject.name | ||
if (project.hasProperty('rootProjectOverride')) { | ||
slug = project.rootProjectOverride | ||
} | ||
|
||
url = "https://github.com/web3j/$slug" | ||
connection = "scm:https://github.com/web3j/${slug}.git" | ||
developerConnection = "scm:git://github.com/web3j/${slug}.git" | ||
} | ||
|
||
developers { | ||
developer { | ||
id = 'conor10' | ||
name = 'Conor Svensson' | ||
email = '[email protected]' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
nexusPublishing { | ||
repositories { | ||
sonatype { | ||
username = System.getenv('OSSRH_USERNAME') | ||
password = System.getenv('OSSRH_PASSWORD') | ||
} | ||
} | ||
} | ||
|
||
|
||
nexusStaging { | ||
username System.getenv('OSSRH_USERNAME') | ||
password System.getenv('OSSRH_PASSWORD') | ||
packageGroup = rootProject.group | ||
} | ||
|
||
|
||
signing { | ||
sign publishing.publications.maven | ||
def signingKey = new File("$rootDir/web3j.asc") | ||
if (signingKey.exists()) { | ||
useInMemoryPgpKeys(signingKey.getText('UTF-8'), System.getenv('GPG_PASSPHRASE')) | ||
} | ||
} |
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
68 changes: 68 additions & 0 deletions
68
src/main/java/org/web3j/console/EnvironmentVariableDefaultProvider.java
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,68 @@ | ||
/* | ||
* Copyright 2020 Web3 Labs Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
package org.web3j.console; | ||
|
||
import java.util.Arrays; | ||
import java.util.Locale; | ||
import java.util.Map; | ||
import java.util.Objects; | ||
import java.util.stream.Stream; | ||
|
||
import picocli.CommandLine.IDefaultValueProvider; | ||
import picocli.CommandLine.Model.ArgSpec; | ||
import picocli.CommandLine.Model.OptionSpec; | ||
|
||
import static org.web3j.console.EnvironmentVariablesProperties.*; | ||
|
||
public class EnvironmentVariableDefaultProvider implements IDefaultValueProvider { | ||
private final Map<String, String> environment; | ||
|
||
public EnvironmentVariableDefaultProvider(final Map<String, String> environment) { | ||
this.environment = environment; | ||
} | ||
|
||
@Override | ||
public String defaultValue(final ArgSpec argSpec) { | ||
if (!argSpec.isOption()) { | ||
return null; | ||
} | ||
return envVarNames((OptionSpec) argSpec) | ||
.map(environment::get) | ||
.filter(Objects::nonNull) | ||
.findFirst() | ||
.orElse(null); | ||
} | ||
|
||
private Stream<String> envVarNames(final OptionSpec spec) { | ||
return Arrays.stream(spec.names()) | ||
.filter(name -> name.startsWith("--")) // Only long options are allowed | ||
.map(this::fullEnvVarName); | ||
} | ||
|
||
private String fullEnvVarName(final String name) { | ||
String suffix = nameToEnvVarSuffix(name); | ||
String prefix; | ||
if (Arrays.asList(WEB3J_CLI_SPECIFIC_VARIABLES).contains(suffix)) { | ||
prefix = WEB3J_CLI_VAR_PREFIX; | ||
} else if (Arrays.asList(OPENAPI_SPECIFIC_VARIABLES).contains(suffix)) { | ||
prefix = WEB3J_OPENAPI_VAR_PREFIX; | ||
} else { | ||
prefix = WEB3J_VAR_PREFIX; | ||
} | ||
return prefix + suffix; | ||
} | ||
|
||
private String nameToEnvVarSuffix(final String name) { | ||
return name.substring("--".length()).replace('-', '_').toUpperCase(Locale.US); | ||
} | ||
} |
Oops, something went wrong.