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

Commit

Permalink
Issue #36: Renamed upload task to update to reflect consistency with …
Browse files Browse the repository at this point in the history
…appcfg tool.
  • Loading branch information
bmuschko committed Dec 9, 2012
1 parent 67a7de1 commit 82fbf13
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 27 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ web application directory each time you run this task. This behavior can be chan
* `gaeUpdateDos`: Updates the DoS protection configuration for the app, based on the dos.xml file.
* `gaeUpdateIndexes`: Updates datastore indexes in App Engine to include newly added indexes.
* `gaeUpdateQueues`: Updates the task queue configuration (queue.xml) in App Engine.
* `gaeUpload`: Uploads files for an application given the application's root directory. The application ID and version are taken from the appengine-web.xml file.
* `gaeUploadAll`: Uploads your application to App Engine and updates all backends by running the task `gaeUpload` and `gaeUpdateAllBackends`.
* `gaeUpdate`: Uploads files for an application given the application's root directory. The application ID and version are taken from the appengine-web.xml file.
* `gaeUpdateAll`: Uploads your application to App Engine and updates all backends by running the task `gaeUpdate` and `gaeUpdateAllBackends`.
* `gaeVacuumIndexes`: Deletes unused indexes in App Engine server.
* `gaeVersion`: Prints detailed version information about the SDK, Java and the operating system.

Expand Down
41 changes: 21 additions & 20 deletions src/main/groovy/org/gradle/api/plugins/gae/GaePlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@ import org.gradle.api.Task
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.ConfigurationContainer
import org.gradle.api.execution.TaskExecutionGraph
import org.gradle.api.plugins.*
import org.gradle.api.plugins.gae.task.*
import org.gradle.api.plugins.gae.task.appcfg.*
import org.gradle.api.plugins.gae.task.appcfg.backends.*
import org.gradle.api.tasks.SourceSet
import org.gradle.api.tasks.SourceSetContainer
import org.gradle.api.tasks.testing.Test
import org.gradle.plugins.ide.eclipse.EclipsePlugin
import org.gradle.plugins.ide.idea.IdeaPlugin
import org.gradle.api.plugins.*
import org.gradle.api.plugins.gae.task.*
import org.gradle.api.plugins.gae.task.appcfg.*
import org.gradle.api.plugins.gae.task.appcfg.backends.*

import static org.gradle.api.tasks.SourceSet.MAIN_SOURCE_SET_NAME

/**
Expand All @@ -46,7 +47,7 @@ class GaePlugin implements Plugin<Project> {
static final String GAE_RUN = 'gaeRun'
static final String GAE_STOP = 'gaeStop'
static final String GAE_ENHANCE = 'gaeEnhance'
static final String GAE_UPLOAD = 'gaeUpload'
static final String GAE_UPDATE = 'gaeUpdate'
static final String GAE_ROLLBACK = 'gaeRollback'
static final String GAE_UPDATE_INDEXES = 'gaeUpdateIndexes'
static final String GAE_VACUUM_INDEXES = 'gaeVacuumIndexes'
Expand All @@ -66,7 +67,7 @@ class GaePlugin implements Plugin<Project> {
static final String GAE_STOP_BACKEND = 'gaeStopBackend'
static final String GAE_DELETE_BACKEND = 'gaeDeleteBackend'
static final String GAE_CONFIGURE_BACKENDS = 'gaeConfigureBackends'
static final String GAE_UPLOAD_ALL = 'gaeUploadAll'
static final String GAE_UPDATE_ALL = 'gaeUpdateAll'
static final String GAE_FUNCTIONAL_TEST = 'gaeFunctionalTest'
static final String GRADLE_USER_PROP_PASSWORD = 'gaePassword'
static final String STOP_PORT_CONVENTION_PARAM = 'stopPort'
Expand Down Expand Up @@ -100,7 +101,7 @@ class GaePlugin implements Plugin<Project> {
configureGaeRun(project, gaePluginConvention, explodedWarDirectory)
configureGaeStop(project, gaePluginConvention)
configureGaeEnhance(project)
configureGaeUpload(project, explodedWarDirectory)
configureGaeUpdate(project, explodedWarDirectory)
configureGaeRollback(project)
configureGaeUpdateIndexes(project)
configureGaeVacuumIndexes(project)
Expand All @@ -121,7 +122,7 @@ class GaePlugin implements Plugin<Project> {
configureGaeStopBackend(project)
configureGaeDeleteBackend(project)
configureGaeConfigureBackends(project)
configureGaeUploadAll(project)
configureGaeUpdateAll(project)
configureGaeFunctionalTest(project, gaePluginConvention)
}

Expand Down Expand Up @@ -274,15 +275,15 @@ class GaePlugin implements Plugin<Project> {
}
}

private void configureGaeUpload(Project project, File explodedWarDirectory) {
project.tasks.withType(GaeUploadTask).whenTaskAdded { GaeUploadTask gaeUploadTask ->
gaeUploadTask.conventionMapping.map(EXPLODED_WAR_DIR_CONVENTION_PARAM) { explodedWarDirectory }
private void configureGaeUpdate(Project project, File explodedWarDirectory) {
project.tasks.withType(GaeUpdateTask).whenTaskAdded { GaeUpdateTask gaeUpdateTask ->
gaeUpdateTask.conventionMapping.map(EXPLODED_WAR_DIR_CONVENTION_PARAM) { explodedWarDirectory }
}

GaeUploadTask gaeUploadTask = project.tasks.add(GAE_UPLOAD, GaeUploadTask)
gaeUploadTask.description = 'Uploads your application to App Engine.'
gaeUploadTask.group = GAE_GROUP
gaeUploadTask.dependsOn project.gaeExplodeWar
GaeUpdateTask gaeUpdateTask = project.tasks.add(GAE_UPDATE, GaeUpdateTask)
gaeUpdateTask.description = 'Updates your application on App Engine.'
gaeUpdateTask.group = GAE_GROUP
gaeUpdateTask.dependsOn project.gaeExplodeWar
}

private void configureGaeRollback(Project project) {
Expand Down Expand Up @@ -432,11 +433,11 @@ class GaePlugin implements Plugin<Project> {
gaeConfigureBackendsTask.conventionMapping.map('setting') { project.property(SETTING_PROJECT_PROPERTY) }
}

private void configureGaeUploadAll(Project project) {
Task gaeUploadAllTask = project.tasks.add(GAE_UPLOAD_ALL)
gaeUploadAllTask.description = 'Uploads your application to App Engine and updates all backends.'
gaeUploadAllTask.group = GAE_GROUP
gaeUploadAllTask.dependsOn project.gaeUpload, project.gaeUpdateAllBackends
private void configureGaeUpdateAll(Project project) {
Task gaeUpdateAllTask = project.tasks.add(GAE_UPDATE_ALL)
gaeUpdateAllTask.description = 'Updates your application and all backends on App Engine.'
gaeUpdateAllTask.group = GAE_GROUP
gaeUpdateAllTask.dependsOn project.gaeUpdate, project.gaeUpdateAllBackends
}

private void configureGaeFunctionalTest(Project project, GaePluginConvention convention) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,28 @@ import org.gradle.api.plugins.gae.task.Explodable
import org.gradle.api.tasks.InputDirectory

/**
* Google App Engine task uploading your application to the server.
* Google App Engine task updating your application on the server.
*
* @see <a href="http://code.google.com/appengine/docs/java/tools/uploadinganapp.html#Uploading_the_App">Documentation</a>
* @author Benjamin Muschko
*/
class GaeUploadTask extends GaeAppConfigTaskTemplate implements Explodable {
class GaeUpdateTask extends GaeAppConfigTaskTemplate implements Explodable {
static final String COMMAND = 'update'
@InputDirectory File explodedWarDirectory

@Override
String startLogMessage() {
'Starting upload process...'
'Starting update process...'
}

@Override
String errorLogMessage() {
'An error occurred uploading the application to App Engine.'
'An error occurred updating the application on App Engine.'
}

@Override
String finishLogMessage() {
'Finished uploading process.'
'Finished updating process.'
}

@Override
Expand Down

0 comments on commit 82fbf13

Please sign in to comment.