Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benstuffs #77

Closed
wants to merge 61 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
f8bb877
avoiding the NPE if there is no default command in a group
mhgrove Jan 23, 2013
18b1446
adding optional discussion and example section at the end of the usag…
mhgrove Jan 23, 2013
e99c95f
removed the trim from the table printer in an earlier commit, which b…
mhgrove Jan 24, 2013
f1603c4
small fix for default command parsing to avoid errors when they're us…
mhgrove Jan 24, 2013
2795807
Support running default command of a group with arguments
evren Jan 24, 2013
38b8aef
another minor adjustment to default command handling for the default …
mhgrove Jan 24, 2013
d08240e
merging in 2795807
mhgrove Jan 24, 2013
8fe108c
Ignoring eclipse bin folder.
Feb 6, 2013
4bad01e
Fixed bug on arguments separator, which makes the option arity flexible.
Feb 7, 2013
fc6427c
Modified arity value in test just to make it more clear.
Feb 7, 2013
77e928d
Merge branch 'feature/argsArity' into develop
Feb 7, 2013
3658456
Updated authors.
Feb 7, 2013
fe2f9b9
Fixed option parsing for high arity values, and added corresponding t…
Feb 22, 2013
0aff15d
* add the ability to get a group via the CliBuilder
mhgrove Feb 27, 2013
a509968
* basic full test suite for airline, runs as a separate program, so n…
mhgrove Feb 27, 2013
e50579d
* merging changes in from another fork, airline/tesla (https://github…
mhgrove Feb 27, 2013
5197195
* merging changes in from another fork, airline/tesla (https://github…
mhgrove Feb 27, 2013
cee1acf
* merging changes in from another fork, airline/tesla (https://github…
mhgrove Feb 27, 2013
bc9089c
* merging changes in from another fork, airline/tesla (https://github…
mhgrove Feb 27, 2013
5a38631
* merging changes in from another fork, airline/tesla (https://github…
mhgrove Feb 27, 2013
5e9693b
* merging changes in from another fork, airline/tesla (https://github…
mhgrove Feb 27, 2013
e3d1e2c
* merging changes in from another fork, airline/tesla (https://github…
mhgrove Feb 27, 2013
9b97e1f
* merging changes in from another fork, airline/tesla (https://github…
mhgrove Feb 27, 2013
bbaaa5d
* bump airline to 0.7 internally
mhgrove Feb 27, 2013
ceffc60
* actually using the command factory in the Cli if you specify it in …
mhgrove Feb 27, 2013
002268a
Merge branch 'release/0.7'
mhgrove Feb 27, 2013
79ccfb2
modifying how option sets are coalesced during parsing to ensure the …
mhgrove Mar 1, 2013
0bfcd5f
* adding a usage printer for an HTML format, only works for a specifi…
mhgrove Apr 15, 2013
dd1ff78
* bumping airline rev
mhgrove Apr 15, 2013
854f9e4
Added default command to synopsis.
May 21, 2013
f50c22c
Titles with multiple names for arguments.
May 21, 2013
8c5e8e2
Made a couple of improvements in the help system and the rendering lo…
May 21, 2013
e93961a
bumped version to 0.7.2
May 21, 2013
bc315b7
Updated CommandGroupUsage to print each command's arguments when prin…
cp-autobuild Oct 23, 2013
369b88e
Added spaces between [ ] and other elements for better readability. U…
cp-autobuild Oct 24, 2013
af3e0f4
Refactored CommandGroupUsage to factor out common command arguments/o…
cp-autobuild Oct 25, 2013
34a3bbf
Incremented version number
cp-autobuild Oct 25, 2013
cc1714b
Merge pull request #1 from snowell/feature/betterGroupOutput
mhgrove Oct 25, 2013
c279f36
Merge branch 'feature/betterGroupOutput' into develop
cp-autobuild Oct 25, 2013
7078de4
Merge remote-tracking branch 'upstream/master' into develop
cp-autobuild Oct 25, 2013
7e8941b
Added USAGE_AS_RONN param to Help.java and the ability to output ronn…
cp-autobuild Oct 28, 2013
a7c8115
Merge pull request #2 from snowell/feature/ronnOutput
mhgrove Oct 29, 2013
5e055c0
Changed spaces to underscores in man page names because ronn requires…
cp-autobuild Oct 29, 2013
1d06aca
Merge pull request #3 from snowell/feature/ronnUpdate
mhgrove Oct 29, 2013
1186aa6
Fix Issue #26
rvesse Nov 13, 2013
a647950
Remove incorrect copyright header
rvesse Nov 15, 2013
01a08f6
merging pull reset 4
mhgrove Nov 21, 2013
625b14e
* Migrated to gradle.
Feb 11, 2015
a98e850
* Updating readme.
Feb 11, 2015
dbc26a1
* Updating artifactory settings.
Feb 11, 2015
688f62d
* Upgraded guava
Mar 2, 2015
594fe0c
Merge branch 'release/v0.7.3'
Mar 2, 2015
4e3cb51
Merge tag 'v0.7.3' into develop
Mar 2, 2015
5d8b5d1
* Added task for uploading to public repo.
Mar 18, 2015
1151003
Throw exception on unknown command instead of println so the appropri…
snowell Feb 1, 2018
8cdac4f
Add SafeVarargs
leventov Mar 27, 2018
53356ac
Upgrade Guava to 25.1-jre
leventov Jun 22, 2018
0e4956e
Bump gradle and guava version
toktarev Feb 18, 2020
6716aec
Update README.md
BenergySD Aug 20, 2020
6c68253
Merge pull request #5 from BenergySD/patch-1
mhgrove Aug 20, 2020
64153e8
Ben's changes for markdown support
PaulJackson123 Sep 24, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ atlassian-ide-plugin.xml
.classpath
.project
.settings
.project
temp-testng-customsuite.xml
.externalToolBuilders
*~
.rvmrc
bin/

build/
.gradle/
gradle.properties
1 change: 0 additions & 1 deletion .travis.yml

This file was deleted.

27 changes: 17 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@ Airline

Airline is a Java annotation-based framework for parsing Git like command line structures.

Latest release is 0.6, available from Maven Central.

```xml
<dependency>
<groupId>io.airlift</groupId>
<artifactId>airline</artifactId>
<version>0.6</version>
</dependency>
```

Here is a quick example:

```java
Expand Down Expand Up @@ -289,3 +279,20 @@ OPTIONS
-h, --help
Display help information
```

**Updating manpages**
===================

1: In `~/.gradle.properites` : (example url is for adjusting manpages)
```
artifactoryUrl=https://stardog.jfrog.io/stardog/cp-internal
artifactoryUsername=......
artifactoryPassword=......
```
2: In airline and stardog root level `build.gradle` Update airline's version number

3: in airline repo: `./gradlew clean install`

4: in stardog repo: `./gradlew clean dist` (only do this once)

5: for manpage generation - `./gradlew manPages`. (needs ronn)
118 changes: 118 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: "maven"

tasks.create(name: 'wrapper_task' ,type: Wrapper) {
gradleVersion = '6.0.1'
distributionUrl = "https://services.gradle.org/distributions/gradle-6.0.1-all.zip"
}

allprojects {
group = "com.complexible.airline"
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
version = "0.7.8"

repositories {
mavenCentral()
}
}

ext {
projectDescription = "Airline is a Java annotation-based framework for parsing Git like command line structures."
projectUrl = "https://github.com/clarkparsia/airline"
}


dependencies {
compile 'javax.inject:javax.inject:1'
compile "com.google.guava:guava:27.0-jre"
compile 'com.google.code.findbugs:jsr305:3.0.0'

testCompile 'org.testng:testng:6.0.1'
}

if (project.hasProperty('artifactoryUrl')
&& project.hasProperty('artifactoryUsername')
&& project.hasProperty('artifactoryPassword')) {

repoUpload(taskName: 'uploadArtifactory',
url: artifactoryUrl,
username: artifactoryUsername,
password: artifactoryPassword)
}

if (project.hasProperty('publicRepository')) {
repoUpload(taskName: 'uploadGithub',
url: "file://localhost/$publicRepository")
}

def repoUpload(Map<String, String> options) {
def taskName = options.taskName
def repoUrl = options.url
def username = null
def passwd = null
def auth = options.containsKey("username") && options.containsKey("password")
if (auth) {
username = options.username
passwd = options.password
}

task(taskName, type: Upload) {
configuration = configurations.archives
repositories {
mavenDeployer {
repository(url: repoUrl) {
if (auth) {
authentication(userName: username, password: passwd)
}
}
pom.project {
name = archivesBaseName
packaging = 'jar'
description projectDescription
url projectUrl
}

//mess with the generated pom to remove test dependencies from published artifacts
pom.withXml { XmlProvider xmlProvider ->
def xml = xmlProvider.asString()
def pomXml = new XmlParser().parse(new ByteArrayInputStream(xml.toString().bytes))

pomXml.dependencies.dependency.each { dep ->
if (dep.scope.text() != 'compile') {
def parent = dep.parent()
parent.remove(dep)
}
}

// add exclusion nodes (only for compile conf) since the maven plugin
// doesn't handle them as of gradle 1.9
project.configurations.compile.allDependencies.findAll {
it instanceof ModuleDependency && !it.excludeRules.isEmpty()
}.each { ModuleDependency dep ->
def xmlDep = pomXml.dependencies.dependency.find {
it.groupId[0].text() == dep.group && it.artifactId[0].text() == dep.name
}
def xmlExclusions = xmlDep.exclusions
if (!xmlExclusions) xmlExclusions = xmlDep.appendNode('exclusions')

dep.excludeRules.each { ExcludeRule rule ->
def xmlExclusion = xmlExclusions.appendNode('exclusion')
xmlExclusion.appendNode('groupId', rule.group)
xmlExclusion.appendNode('artifactId', rule.module ?: '*')
}
}

def newXml = new StringWriter()
def printer = new XmlNodePrinter(new PrintWriter(newXml))
printer.preserveWhitespace = true
printer.print(pomXml)
xml.setLength(0)
xml.append(newXml.toString())
}

}
}
}
}
4 changes: 4 additions & 0 deletions gradle.properties.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
publicRepository=/path/to/your/maven/checkout
artifactoryUrl=/url/to/repo
artifactoryUsername=user
artifactoryPassword=secret
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Wed Feb 11 10:07:24 EST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip
164 changes: 164 additions & 0 deletions gradlew
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
#!/usr/bin/env bash

##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
echo "$*"
}

die ( ) {
echo
echo "$*"
echo
exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac

# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option

if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
Loading