You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 17, 2022. It is now read-only.
I've started on support for CommonJS modules, but I'm brand new to Gradle, so I'd love some tips.
Basic idea is that any JS repo w/ a package.json should be resolvable with something like:
class GithubCommonJsDependency {
String userName
String name
String repoName
GithubCommonJsDependency(String packageJsonUrl, String version = "master") {
// Example: https://github.com/vodori/dojo/blob/master/package.json
// /vodori is the userName
// /dojo is the repoName
userName = packageJsonUrl.split("github.com/")[1].split("/")[0]
name = repoName = packageJsonUrl.split("github.com/")[1].split("/")[1]
}
File getZip() {
Object tag = getTagByName(version)
return new File((tag.getAt("zipball_url") as String).toURL().getText())
}
Object getTagByName(String name) {
// SEE: http://developer.github.com/v3/
// TODO: This could be a whole lot nicer.
String tagJson = "https://api.github.com/repos/${userName}/$repoName/tags".toURL().getText()
ArrayList<Object> tags = new JsonSlurper().parseText(tagJson) as ArrayList<Object>
for (Object tag in tags) {
if (tag.name == name) {
return tag
}
}
return null
}
}
Initial concept comes from VoloJS, which is a great concept, but requires Node and does more than just resolve packages.
Please let me know if you're interested. I'll probably be bothering you with pull requests fairly frequently with related and advice on what you're looking for would be great.
All the best,
Josh
The text was updated successfully, but these errors were encountered:
Greetings,
I've started on support for CommonJS modules, but I'm brand new to Gradle, so I'd love some tips.
Basic idea is that any JS repo w/ a package.json should be resolvable with something like:
Initial concept comes from VoloJS, which is a great concept, but requires Node and does more than just resolve packages.
Please let me know if you're interested. I'll probably be bothering you with pull requests fairly frequently with related and advice on what you're looking for would be great.
All the best,
Josh
The text was updated successfully, but these errors were encountered: