Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

Commit

Permalink
Issue #35: Exposed noCookies and oauth2 convention properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
bmuschko committed Dec 9, 2012
1 parent cb29c62 commit 67a7de1
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ Within `gae` you can define optional properties in a closure named `appcfg`:
If omitted and no cookie is stored from a previous use of the command, the command will prompt for this value.
* `server`: The App Engine server hostname (defaults to appengine.google.com).
* `host`: The hostname of the local machine for use with remote procedure calls.
* `noCookies`: Do not store the administrator sign-in credentials. Prompt for a password every time. (or go through the OAuth2 flow when the `oauth2` option is used).
* `passIn`: Do not store the administrator sign-in credentials as a cookie; prompt for a password every time. If the property
`password` was provided then this value will always be true.
* `password`: The password in plain text to be used whenever a task requires one. The password is only applied if the `email`
Expand All @@ -106,6 +107,7 @@ convention property was provided also. Alternatively, you can set the password i
* `httpProxy`: Use the given HTTP proxy to contact App Engine.
* `httpsProxy`: Use the given HTTPS proxy to contact App Engine, when using HTTPS. If `httpProxy` is given but `httpsProxy`
is not, both HTTP and HTTPS requests will use the given proxy.
* `oauth2`: Use OAuth2 authentication instead of password-based authentication.

The task `gaeDownloadApp` requires you to at least define the application ID and directory to write the files to. Define the tasks' properties in the
closure `app`:
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repositories {
}

dependencies {
groovy fileTree(dir: new File(gradle.gradleHomeDir, 'lib'), includes: ['**/groovy-all-*.jar'])
groovy localGroovy()
compile gradleApi()
compile 'eu.appsatori:gradle-fatjar-plugin:0.1.3', {
ext.optional = true
Expand Down
2 changes: 2 additions & 0 deletions src/main/groovy/org/gradle/api/plugins/gae/GaePlugin.groovy
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,15 @@ class GaePlugin implements Plugin<Project> {
gaeAppConfigTaskTemplate.conventionMapping.map('email') { gaePluginConvention.appCfg.email }
gaeAppConfigTaskTemplate.conventionMapping.map('server') { gaePluginConvention.appCfg.server }
gaeAppConfigTaskTemplate.conventionMapping.map('host') { gaePluginConvention.appCfg.host }
gaeAppConfigTaskTemplate.conventionMapping.map('noCookies') { gaePluginConvention.appCfg.noCookies }
gaeAppConfigTaskTemplate.conventionMapping.map('passIn') { gaePluginConvention.appCfg.passIn }
gaeAppConfigTaskTemplate.conventionMapping.map('password') {
// Password from gradle.properties takes precedence
project.hasProperty(GRADLE_USER_PROP_PASSWORD) ? project.property(GRADLE_USER_PROP_PASSWORD) : gaePluginConvention.appCfg.password
}
gaeAppConfigTaskTemplate.conventionMapping.map('httpProxy') { gaePluginConvention.appCfg.httpProxy }
gaeAppConfigTaskTemplate.conventionMapping.map('httpsProxy') { gaePluginConvention.appCfg.httpsProxy }
gaeAppConfigTaskTemplate.conventionMapping.map('oauth2') { gaePluginConvention.appCfg.oauth2 }
}
}

Expand Down
Empty file.
11 changes: 11 additions & 0 deletions src/main/groovy/org/gradle/api/plugins/gae/task/appcfg/GaeAppConfigTaskTemplate.groovy
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ abstract class GaeAppConfigTaskTemplate extends GaeWebAppDirTask {
String email
String server
String host
Boolean noCookies
Boolean passIn
String password
String httpProxy
String httpsProxy
Boolean oauth2

@Override
void executeTask() {
Expand Down Expand Up @@ -86,6 +88,10 @@ abstract class GaeAppConfigTaskTemplate extends GaeWebAppDirTask {
params << "--host=${getHost()}"
}

if(getNoCookies()) {
params << '--no_cookies'
}

if(getPassIn() || getPassword()) {
params << '--passin'
}
Expand All @@ -97,6 +103,11 @@ abstract class GaeAppConfigTaskTemplate extends GaeWebAppDirTask {
if(getHttpsProxy()) {
params << "--proxy_https=${getHttpsProxy()}"
}

if(getOauth2()) {
params << '--oauth2'
}

}

private class AppConfigRunnable implements Runnable {
Expand Down

0 comments on commit 67a7de1

Please sign in to comment.