-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a basic github extension and github task.
Refs #7.
- Loading branch information
Showing
5 changed files
with
83 additions
and
0 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
51 changes: 51 additions & 0 deletions
51
gruel/src/main/groovy/com/glasstowerstudios/gruel/extensions/GithubExtension.groovy
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,51 @@ | ||
package com.glasstowerstudios.gruel.extensions; | ||
|
||
/** | ||
* Plugin extension file. This allows specific parameters to be defined in the | ||
* plugin itself. (Think of it like mini-plugins within the Gruel plugin). | ||
* | ||
* For the Github extension, the repository must always be provided, along with | ||
* either a username/password combination, or an auth token. | ||
*/ | ||
class GithubExtension { | ||
String auth_token; | ||
String username; | ||
String password; | ||
String repo; | ||
|
||
boolean isValid() { | ||
return repo != null && !repo.isEmpty() && ((auth_token != null && !auth_token.isEmpty()) || (username != null && !username.isEmpty() && password != null && !password.isEmpty())); | ||
} | ||
|
||
String getUsername() { | ||
return username; | ||
} | ||
|
||
String getPassword() { | ||
return password; | ||
} | ||
|
||
String getRepo() { | ||
return repo; | ||
} | ||
|
||
String getAuthToken() { | ||
return auth_token; | ||
} | ||
|
||
void setAuthToken(String aToken) { | ||
auth_token = aToken; | ||
} | ||
|
||
void setUsername(String aUsername) { | ||
username = aUsername; | ||
} | ||
|
||
void setPassword(String aPassword) { | ||
password = aPassword; | ||
} | ||
|
||
void setRepo(String aRepo) { | ||
repo = aRepo; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
gruel/src/main/groovy/com/glasstowerstudios/gruel/tasks/github/GithubTask.groovy
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,13 @@ | ||
package com.glasstowerstudios.gruel.tasks.github | ||
|
||
import com.glasstowerstudios.gruel.tasks.GruelTask | ||
import org.gradle.api.tasks.TaskAction | ||
|
||
class GithubTask extends GruelTask { | ||
@TaskAction | ||
def doTask() { | ||
println "Github Username: " + project.github.username; | ||
println "Github Password: " + project.github.password; | ||
println "Github Repo: " + project.github.repo; | ||
} | ||
} |
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