Skip to content

Commit ecd5bcd

Browse files
authored
Add gradle maven (GoogleCloudPlatform#111)
* Use the new plugins * fix script & README 1. copyright to correct year 2. Links to docs. * Update maven version * Add Helloworld-compat * Fix README * rm extra file; fix name * Make Tim happy... Add doing an GAE API.
1 parent fa8d3f8 commit ecd5bcd

14 files changed

Lines changed: 571 additions & 2 deletions

File tree

helloworld-compat/README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Google App Engine Flex Environment "compat" Hello World Sample
2+
3+
This sample demonstrates how to deploy an application on Google App Engine.
4+
5+
See the [Google App Engine standard environment documentation][ae-docs] for more
6+
detailed instructions.
7+
8+
[ae-docs]: https://cloud.google.com/appengine/docs/java/
9+
10+
## Setup
11+
12+
Use either:
13+
14+
* `gcloud init`
15+
* `gcloud beta auth application-default login`
16+
17+
## Maven
18+
### Running locally
19+
20+
$ mvn appengine:run
21+
22+
### Deploying
23+
24+
$ mvn appengine:deploy
25+
26+
## Gradle
27+
### Running locally
28+
29+
$ gradle appengineRun
30+
31+
If you do not have gradle installed, you can run using `./gradlew appengineRun`.
32+
33+
### Deploying
34+
35+
$ gradle appengineDeploy
36+
37+
If you do not have gradle installed, you can deploy using `./gradlew appengineDeploy`.
38+
39+
<!--
40+
## Intelij Idea
41+
Limitations - Appengine Standard support in the Intellij plugin is only available for the Ultimate Edition of Idea.
42+
43+
### Install and Set Up Cloud Tools for IntelliJ
44+
45+
To use Cloud Tools for IntelliJ, you must first install IntelliJ IDEA Ultimate edition.
46+
47+
Next, install the plugins from the IntelliJ IDEA Plugin Repository.
48+
49+
To install the plugins:
50+
51+
1. From inside IDEA, open File > Settings (on Mac OS X, open IntelliJ IDEA > Preferences).
52+
1. In the left-hand pane, select Plugins.
53+
1. Click Browse repositories.
54+
1. In the dialog that opens, select Google Cloud Tools.
55+
1. Click Install.
56+
1. Click Close.
57+
1. Click OK in the Settings dialog.
58+
1. Click Restart (or you can click Postpone, but the plugins will not be available until you do restart IDEA.)
59+
60+
### Running locally
61+
62+
### Deploying
63+
-->

helloworld-compat/build.gradle

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// Copyright 2015 Google Inc. All Rights Reserved.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
// [START gradle]
15+
buildscript { // Configuration for building
16+
repositories {
17+
jcenter() // Bintray's repository - a fast Maven Central mirror & more
18+
mavenCentral()
19+
}
20+
dependencies {
21+
classpath 'com.google.cloud.tools:appengine-gradle-plugin:+' // latest App Engine Gradle tasks
22+
}
23+
}
24+
25+
repositories { // repositories for Jar's you access in your code
26+
maven {
27+
url 'https://maven-central.storage.googleapis.com' // Google's mirror of Maven Central
28+
// url 'https://oss.sonatype.org/content/repositories/snapshots' // SNAPSHOT Reposiotry (if needed)
29+
}
30+
jcenter()
31+
mavenCentral()
32+
}
33+
34+
apply plugin: 'java' // standard Java tasks
35+
apply plugin: 'war' // standard Web Archive plugin
36+
apply plugin: 'com.google.cloud.tools.appengine' // App Engine tasks
37+
38+
dependencies {
39+
providedCompile 'javax.servlet:javax.servlet-api:3.1.0'
40+
compile 'com.google.appengine:appengine:+'
41+
// Add your dependencies here.
42+
43+
}
44+
45+
// [START model]
46+
model {
47+
appengine { // App Engine tasks configuration
48+
run { // local (dev_appserver) configuration (standard environments only)
49+
port = 8080 // default
50+
}
51+
52+
deploy { // deploy configuration
53+
stopPreviousVersion = true // default - stop the current version
54+
promote = true // default - & make this the current version
55+
}
56+
}
57+
}
58+
// [END model]
59+
60+
group = 'com.example.appengine' // Generated output GroupId
61+
version = '1.0-SNAPSHOT' // Version in generated output
62+
63+
sourceCompatibility = JavaVersion.VERSION_1_8
64+
targetCompatibility = JavaVersion.VERSION_1_8
65+
// [END gradle]
52.1 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Wed Aug 17 16:32:26 PDT 2016
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip

helloworld-compat/gradlew

Lines changed: 164 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

helloworld-compat/gradlew.bat

Lines changed: 90 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)