-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:spgroup/groundhog
- Loading branch information
Showing
23 changed files
with
508 additions
and
329 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,50 +17,99 @@ In order for it to behave like an Eclipse project, you'll need to install the Ma | |
|
||
`$ mvn eclipse:eclipse` | ||
|
||
## Usage | ||
|
||
### Generating the JAR | ||
|
||
Generate the JAR file for the Groundhog project. | ||
|
||
Eclipse users can go to `File > Export > Runnable Jar File` and enter the `CmdMain` class for the option "Launch Configuration". | ||
Eclipse users can go to `File > Export > Runnable JAR File` and enter the `CmdMain` class for the option "Launch Configuration". | ||
|
||
### Running Groundhog | ||
## Usage | ||
|
||
Search GitHub for projects matching "phonegap-facebook-plugin" and place the results (if any) in a folder called metrics: | ||
You can use Groundhog in two ways: as an executable JAR from the command line or as a library in your own Java project. | ||
|
||
```shell | ||
$ java -jar groundhog.jar -forge github -out metrics phonegap-facebook-plugin | ||
### Fetching Metadata | ||
|
||
Metadata is fetched from GitHub's API. In order to be able to fetch more objects, you need to [obtain your GitHub API token](https://github.com/settings/applications) and use it in Groundhog. | ||
|
||
#### Project | ||
|
||
You can use Groundhog to fetch metadata on a list of projects that attend to a criteria | ||
|
||
```java | ||
// Create a GitHub search object | ||
Injector injector = Guice.createInjector(new SearchModule()); | ||
SearchGitHub searchGitHub = injector.getInstance(SearchGitHub.class); | ||
|
||
// Search for projects named "opencv" starting in page 1 and stoping and going until the 3rd project | ||
List<Project> projects = searchGitHub.getProjects("opencv", 1, 3); | ||
``` | ||
|
||
### Running tests | ||
Alternatively, you can search for projects without setting the limiting point. In this case Groundhog will fetch projects until your API limit is exceeded. | ||
|
||
```java | ||
List<Project> projects = searchGitHub.getProjects("eclipse", 1, SearchGitHub.INFINITY) | ||
``` | ||
$ mvn test | ||
|
||
#### Issues | ||
|
||
Issues are objects that only make sense from a Project perspective. | ||
|
||
To fetch the Issues of a given project using Groundhog you should first create the Project and then tell Groundhog to hit the API and get the data. | ||
|
||
```java | ||
User user = new User("joyent"); // Create the User object | ||
Project pr = new Project(user, "node"); // Create the Project object | ||
|
||
// Tell Groundhog to fetch all Issues of that project and assign them the the Project object: | ||
List<Issue> issues = searchGitHub.getAllProjectIssues(pr); | ||
|
||
System.out.println("Listing 'em Issues..."); | ||
for (Issue issue: issues) { | ||
System.out.println(issue.getTitle()); | ||
} | ||
``` | ||
|
||
## Info | ||
#### Milestones | ||
|
||
### Supported Forges | ||
Just like Issues, Groundhog lets you fetch the list of Milestones of a project, too. | ||
|
||
* GitHub | ||
* Google Code | ||
* SourceForge | ||
```java | ||
List<Milestone> milestones = searchGitHub.getAllProjectMilestones(pr); | ||
``` | ||
|
||
#### Languages | ||
|
||
Software projects are often composed of more than one programming language. Groundhog lets you fetch the list of languages of a project among its LoC (lines of code) count. | ||
|
||
```java | ||
// Returns a List of Language objects for each language of project "pr" | ||
List<Language> languages = searchGitHub.fetchProjectLanguages(pr); | ||
``` | ||
|
||
### Supported Programming Languages | ||
#### Contributors | ||
|
||
* Java, parsing only (more to be added later) | ||
You can also get the list of people who contributed to a project on GitHub: | ||
|
||
### Forge Search | ||
```java | ||
User user = new User("rails"); | ||
Project project = new Project(user, "rails"); // project github.com/rails/rails | ||
|
||
* **GitHub**: | ||
Groundhog uses the [GitHub API v3] to search for repositories on GitHub | ||
List<User> contributors = searchGitHub.getAllProjectContributors(project); | ||
``` | ||
|
||
* **Google Code**: | ||
to be written | ||
### Running Groundhog | ||
|
||
* **SourceForge**: | ||
to be written | ||
Search GitHub for projects matching "phonegap-facebook-plugin" and place the results (if any) in a folder called metrics: | ||
|
||
```shell | ||
$ java -jar groundhog.jar -forge github -out metrics phonegap-facebook-plugin | ||
``` | ||
|
||
### Running tests | ||
|
||
``` | ||
$ mvn test | ||
``` | ||
|
||
## Documentation | ||
|
||
|
@@ -85,6 +134,8 @@ $ javadoc -d src/src/groundhog br.cin.ufpe.groundhog | |
|
||
* Fernando Castor {[email protected]} | ||
|
||
* Jesus Silva {[email protected]} | ||
|
||
## Contributions | ||
|
||
Want to contribute with code, documentation or bug report? That's great, check out the [Issues] page. | ||
|
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
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
Oops, something went wrong.