Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Update endpoints archetypes with new tooling (#54)
Browse files Browse the repository at this point in the history
* Updating endpoints tooling
* Added gradle build support
* Added endpoints v1.0 and v2.0 support to archetype
* Moving and changing copyright header
* Moving copyright below xml header...
* Adding Test for hello-endpoints-archetype
* Adding Gradle appengineDeploy to E2E tests
* Updating Jenkins.sh to fail on non-zero return
* Removing unnecessary paramters application/version
* Removing unnecessary application/version parameters
* Added -x to Jenkins.sh
* Add fail on non-zero and print commands to Jenkins.sh
* Set deployment version for gradle test
* Removing unnecessary setup step from README
* Removed eclipse-launch-profiles
* Updated archetype version - removed "-0"
* Removed -0 from helloendpoints pom.
* Remove nbactions and eclipse profiles
* Updating copyright in hellendpoints and endpointsskeleton
* Removed copyright from auto-generated code
* Modified velocity commented copyrights - remove whitespace.
* Removed unnecessary plugins from endpoints archetypes pom.xml
* Updating Jenkins.sh to be more specific to running instance
* Updating READMEs for endpoints archetypes
* Modifying PROJECT_ID to VERSION_ID in Jenkins.sh tests
* Consolidated Jenkins.sh and archetype/Jenkins.sh
* Updating endpoints archetypes READMEs with note for payment.
* Cleand up pom.xml and removed unnecessary dependency
* Updated Jenkins.sh to be version specific.
* Updating skeleton to act more like an endpoints skeleton
* Updating skeleton endpoints archetype README to reflect changes
* Updating README for helloendpoints archetype
* Removing unused application-id from endpoints archetypes
* Adding header for endpoints archetypes README
* Wrapped environment variables with double-quotes
  • Loading branch information
frankyn authored and lesv committed Feb 1, 2017
1 parent 806b6f3 commit ad77576
Show file tree
Hide file tree
Showing 23 changed files with 631 additions and 406 deletions.
18 changes: 9 additions & 9 deletions endpoints-skeleton-archetype/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2016 Google Inc. All Rights Reserved.
Copyright 2016 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -17,18 +17,18 @@ limitations under the License.
<project>
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.google.appengine.archetypes</groupId>
<artifactId>archetypes</artifactId>
<version>1.0.0</version>
</parent>
<parent>
<groupId>com.google.appengine.archetypes</groupId>
<artifactId>archetypes</artifactId>
<version>1.0.0</version>
</parent>

<groupId>com.google.appengine.archetypes</groupId>
<artifactId>endpoints-skeleton-archetype</artifactId>
<version>1.1.5-${appengine.sdk.version}</version>
<version>2.0.0</version>
<packaging>maven-archetype</packaging>

<name>endpoints-skeleton-archetype</name>
<description>A skeleton project using Cloud Endpoints with Google App Engine Java</description>
<url>https://developers.google.com/appengine/docs/java/endpoints/</url>
<description>A skeleton project using Cloud Endpoints with Google App Engine Standard</description>
<url>https://cloud.google.com/appengine/docs/java/endpoints/</url>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,21 @@
<include>**/*.properties</include>
</includes>
</fileSet>
<fileSet encoding="UTF-8">
<directory>eclipse-launch-profiles</directory>
<includes>
<include>**/*.launch</include>
</includes>
</fileSet>
<fileSet encoding="UTF-8">
<fileSet filtered="true" encoding="UTF-8">
<directory></directory>
<includes>
<include>LICENSE</include>
<include>README.md</include>
<include>nbactions.xml</include>
<include>build.gradle</include>
</includes>
</fileSet>
</fileSets>
<requiredProperties>
<requiredProperty key="appengine-version">
<defaultValue>${appengine.sdk.version}</defaultValue>
</requiredProperty>
<requiredProperty key="application-id">
<defaultValue>your-app-id</defaultValue>
</requiredProperty>
<requiredProperty key="web-client-id">
<defaultValue>replace this with your web client ID</defaultValue>
</requiredProperty>
<requiredProperty key="android-client-id">
<defaultValue>replace this with your Android client ID</defaultValue>
<requiredProperty key="endpoints-fw">
<defaultValue>2.0.0-beta.12</defaultValue>
</requiredProperty>
<requiredProperty key="ios-client-id">
<defaultValue>replace this with your iOS client ID</defaultValue>
<requiredProperty key="endpoints-p">
<defaultValue>1.0.0-beta2</defaultValue>
</requiredProperty>
</requiredProperties>
</archetype-descriptor>
Original file line number Diff line number Diff line change
@@ -1,57 +1,105 @@
endpoints-skeleton
==================

A skeleton application for Google Cloud Endpoints in Java.
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
# Skeleton Google Cloud Endpoints Frameworks for App Engine using a discovery document

This generated sample provides a skeleton to get started with Cloud Endpoints
Frameworks for App Engine using a discovery document. This sample contains comments
of how to use the prior Endpoints Frameworks as well. For clarity, the prior Endpoints
Frameworks and the new Endpoints Frameworks are denoted as Endpoints Frameworks v1.0
and Endpoints Frameworks v2.0 respectively.

Google Cloud Endpoints Frameworks v2.0 provides new functionality which may
require payment and uses an OpenAPI specification instead of the discovery document.
The OpenAPI development process is explained [here][8] and a quickstart is
provided [here][9].

## Products
- [App Engine][1]
- [Google App Engine Standard][1]

## Language
- [Java][2]

## APIs
- [Google Cloud Endpoints][3]
- [Google App Engine Maven plugin][4]
- [Google Cloud Endpoints Frameworks v2.0][8]
- [Google Cloud Endpoints Frameworks v1.0][3]

## Setup Instructions
## Build and Deployment Plugins
- [Google Cloud Endpoints Frameworks Maven Plugin][10]
- [Google Cloud Endpoints Frameworks Gradle Plugin][11]

1. Update the value of `application` in `appengine-web.xml` to the app
ID you have registered in the App Engine admin console and would
like to use to host your instance of this sample.
## Setup

1. Add your API method to `src/main/java/${packageInPathFormat}/YourFirstAPI.java`.

1. Optional step: These sub steps are not required but you need this
if you want to have auth protected methods.
1. [Optional]: Use Cloud Endpoints Frameworks v1.0.

- Uncomment Endpoints Frameworks v1.0 sections and comment
Endpoints Frameworks v2.0 sections in the following files.

```
pom.xml
build.gradle
src/main/webapp/WEB-INF/web.xml
```
## Build and Deployment
### Maven
1. Build a fresh binary with
1. Update the values in `src/main/java/${packageInPathFormat}/Constants.java`
to reflect the respective client IDs you have registered in the
[APIs Console][6].
`mvn clean compile`
1. You also need to supply the web client ID you have registered
in the [APIs Console][4] to your client of choice (web, Android,
iOS).
1. Run the application locally at [localhost:8080][5] with
1. Run the application with `mvn appengine:devserver`, and ensure it's
running by visiting your local server's api explorer's address (by
default [localhost:8080/_ah/api/explorer][5].)
`mvn appengine:run`
1. Get the client library with
1. Explore local server's api explorer with
$ mvnappengine:endpoints_get_client_lib
[localhost:8080/_ah/api/explorer][5]
It will generate a client library jar file under the
`target/endpoints-client-libs/<api-name>/target` directory of your
project, as well as install the artifact into your local maven
repository.
1. Generate the client library in a zip file named `helloworld-v1-java.zip` with
`mvn endpoints-framework:clientLibs`
1. Deploy your application to Google App Engine with
$ mvn appengine:update
`mvn appengine:deploy`
### Gradle
1. Build a fresh binary with
`gradle clean compileJava`
1. Run the application locally at [localhost:8080][5] with
`gradle appengineRun`
1. Explore local server's api explorer with
[localhost:8080/_ah/api/explorer][5]
1. Generate the client library in a zip file named `helloworld-v1-java.zip` with
`gradle endpointsClientLibs`
1. Deploy your application to Google App Engine with
`gradle appengineDeploy`
[1]: https://developers.google.com/appengine
[1]: https://cloud.google.com/appengine/docs/java/
[2]: http://java.com/en/
[3]: https://developers.google.com/appengine/docs/java/endpoints/
[4]: https://developers.google.com/appengine/docs/java/tools/maven
[5]: https://localhost:8080/_ah/api/explorer
[6]: https://console.developers.google.com/
[3]: https://cloud.google.com/appengine/docs/java/endpoints/
[4]: https://cloud.google.com/appengine/docs/java/tools/maven
[5]: https://localhost:8080/
[6]: https://console.developers.google.com/project/_/apiui/credential
[7]: https://cloud.google.com/appengine/docs/java/endpoints/migrating
[8]: https://cloud.google.com/endpoints/docs/frameworks/java/about-cloud-endpoints-frameworks
[9]: https://cloud.google.com/endpoints/docs/frameworks/java/quickstart-frameworks-java
[10]: https://github.com/GoogleCloudPlatform/endpoints-framework-maven-plugin
[11]: https://github.com/GoogleCloudPlatform/endpoints-framework-gradle-plugin
[12]: https://cloud.google.com/endpoints/docs/authenticating-users-frameworks
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
#**
Copyright 2017 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*#
buildscript { // Configuration for building
repositories {
mavenCentral()
jcenter() // Bintray's repository - a fast Maven Central mirror & more
}
dependencies {
classpath 'com.google.cloud.tools:appengine-gradle-plugin:+' // latest App Engine Gradle tasks
classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:${endpoints-p}'
}
}

repositories { // repositories for Jar's you access in your code
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots' // SNAPSHOT Repository (if needed)
}
mavenCentral()
jcenter()
}

apply plugin: 'java' // standard Java tasks
apply plugin: 'war' // standard Web Archive plugin
apply plugin: 'com.google.cloud.tools.appengine' // App Engine tasks
apply plugin: 'com.google.cloud.tools.endpoints-framework-server'

dependencies {
providedCompile group: 'javax.servlet', name: 'servlet-api', version:'2.5'
compile 'jstl:jstl:1.2'
compile group: 'javax.inject', name: 'javax.inject', version: '1'

// Uncomment to use Endpoints Frameworks v1.0
// compile group: 'com.google.appengine', name: 'appengine-endpoints', version: '1.9.48'
// End of Endpoints Frameworks v1.0

// Endpoints Frameworks v2.0
compile "com.google.endpoints:endpoints-frameworks:${endpoints-fw}"
// End of Endpoints Frameworks v2.0
}

appengine { // App Engine tasks configuration
run { // local (dev_appserver) configuration (standard environments only)

}

deploy { // deploy configuration

}
}

group = "${groupId}" // Generated output GroupId
version = "1" // Version in generated output

sourceCompatibility = 1.7 // App Engine Standard uses Java 7
targetCompatibility = 1.7 // App Engine Standard uses Java 7

This file was deleted.

This file was deleted.

Loading

0 comments on commit ad77576

Please sign in to comment.