Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "gradleps", | ||
"version": "0.0.2", | ||
"description": "Search Maven Central and easily add dependency to your Gradle build file.", | ||
"main": "src/gradleps.js", | ||
"bin": { | ||
"gradleps": "./src/gradleps.js" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"bugs": { | ||
"url" : "https://github.com/tomusdrw/gradleps/issues" | ||
}, | ||
"repository" :{ | ||
"type" : "git", | ||
"url" : "https://github.com/tomusdrw/gradleps.git" | ||
}, | ||
"keywords": "maven gradle build automate", | ||
"author": "Tomusdrw <tomusdrw@gmail.com>", | ||
"license": "MIT", | ||
"dependencies": { | ||
"commander": "~2.1.0", | ||
"restler": "~3.1.0", | ||
"q": "~1.0.0", | ||
"colors": "~0.6.2", | ||
"prompt": "~0.2.12" | ||
} | ||
} | ||
"name": "gradleps", | ||
"version": "0.0.3", | ||
"description": "Search Maven Central and easily add dependency to your Gradle build file.", | ||
"main": "src/gradleps.js", | ||
"bin": { | ||
"gradleps": "./src/gradleps.js" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/tomusdrw/gradleps/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/tomusdrw/gradleps.git" | ||
}, | ||
"keywords": "maven gradle build automate", | ||
"author": "Tomusdrw <tomusdrw@gmail.com>", | ||
"license": "MIT", | ||
"dependencies": { | ||
"commander": "~2.1.0", | ||
"restler": "~3.1.0", | ||
"q": "~1.0.0", | ||
"colors": "~0.6.2", | ||
"prompt": "~0.2.12" | ||
} | ||
} |
gradleps | ||
===================== | ||
Tired of searching through Maven Central manually and then adding your dependency? | ||
Npm-style search through Maven Central repository and easy adding dependencies to Gradle buildfile. | ||
## Installation & Usage | ||
```bash | ||
$ npm install gradleps -g | ||
``` | ||
After installation you can search through Maven Central | ||
```bash | ||
$ gradleps search guice --limit 5 | ||
Found 296 results. Displaying first 5: | ||
com.google.inject:guice 4.0-beta | ||
com.jolira:guice 3.0.0 | ||
org.jvnet.hudson:guice 3.0-rc1 | ||
com.mycila.com.google.inject:guice 3.0-20100927 | ||
org.mod4j.com.google.inject:guice 1.0-XTEXT-PATCHED | ||
``` | ||
You can also automatically update your `build.gradle` file. | ||
```bash | ||
$ gradleps install guice -f build.gradle | ||
Possible options: | ||
[y] com.google.inject:guice 4.0-beta | ||
[1] com.jolira:guice 3.0.0 | ||
[2] org.jvnet.hudson:guice 3.0-rc1 | ||
[3] com.mycila.com.google.inject:guice 3.0-20100927 | ||
[4] org.mod4j.com.google.inject:guice 1.0-XTEXT-PATCHED | ||
Installing com.google.inject:guice@4.0-beta | ||
Is it okay? [Y/n/1/2/3/4] choice Y | ||
All done! | ||
``` | ||
## Changelog | ||
0.0.3 - Just print the dependency if dependencies cannot be found. | ||
## Contribution | ||
Any contribution is welcome. Please share your ideas! |
@@ -13,9 +13,12 @@ var colors = require('colors'); | ||
var prefix = isForTests ? 'testCompile' : 'compile'; | ||
var depString = prefix + " '" + entry; | ||
// find proper place | ||
var regex = /^(dependencies\s*{([\s\S]|.)*?)}/m; | ||
var regex = /(dependencies\s*{([\s\S]|.)*?)}/m; | ||
if (!regex.test(file)) { | ||
console.error(("Couldn't locate 'dependencies' section in " + gradleFile).red); | ||
console.log("You can add dependency manually:"); | ||
console.log(depString.cyan); | ||
return; | ||
} | ||
fs.writeFile(gradleFile, file.replace(regex, "$1 " + prefix + " '" + entry + "'\n}"), 'utf8', function(err) { | ||
fs.writeFile(gradleFile, file.replace(regex, "$1 " + depString + "'\n}"), 'utf8', function(err) { | ||
if (err) { | ||
@@ -22,0 +25,0 @@ console.error(("Couldn't write to file " + gradleFile + ".").red); |
@@ -36,3 +36,3 @@ #!/usr/bin/node | ||
program | ||
.version('0.0.2'); | ||
.version('0.0.3'); | ||
@@ -96,8 +96,5 @@ program | ||
program | ||
.command("*") | ||
.action(function() { | ||
program.outputHelp(); | ||
}); | ||
program.parse(process.argv); | ||
var d = program.parse(process.argv); | ||
if (d.args.length === 0) { | ||
program.outputHelp(); | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8945
43