GoogleCloudPlatform / app-gradle-plugin

The library has moved to https://github.com/GoogleCloudPlatform/appengine-plugins/tree/main/app-gradle-plugin
Apache License 2.0
153 stars 40 forks source link

Any way to pass configurations from gradlew command line? #81

Closed junghoahnsc closed 7 years ago

junghoahnsc commented 8 years ago

Hello,

I'm trying to use this plugin and my build.gradle has

 appengine {
    deploy {   // deploy configuration
        stopPreviousVersion = true  // default - stop the current version
        promote = true              // default - & make this the current version
        project = 'my-project'
    }
}

And I'd like to overwrite project with gradlew command line. I tried like

./gradlew appengineDeploy -Pappengine.deploy.project=xxx

but it didn't work. I tried many variants, but I couldn't find a solution.

Thanks,

patflynn commented 7 years ago

@loosebazooka this should work right?

loosebazooka commented 7 years ago

There's no gradle mechanism to do this. You would have to do this on your own, just read the property you set on the command line into the right configuration parameter.

appengine {
  deploy {
    project = property('appengine.deploy.project')
  }
}
./gradlew appengineDeploy -Pappengine.deploy.project=my-project
junghoahnsc commented 7 years ago

Thanks, that's the way what I'm doing now.