Skip to content

Commit

Permalink
Merge pull request #90 from GoogleCloudPlatform/datastore-samples
Browse files Browse the repository at this point in the history
Datastore Concepts snippets and Getting Started app
  • Loading branch information
ajkannan committed Feb 12, 2016
2 parents 7ce1a32 + 63f756a commit 2c88e44
Show file tree
Hide file tree
Showing 5 changed files with 1,364 additions and 0 deletions.
14 changes: 14 additions & 0 deletions datastore/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Datastore Samples

This directory contains sample code used in Google Cloud Datastore documentation. Included here is a sample command line application, `TaskList`, that interacts with Datastore to manage a to-do list.

## Run the `TaskList` sample application.

1. Ensure that you have:
* Created a Google Developers Console project with the Datastore API enabled. Follow [these instructions](https://cloud.google.com/docs/authentication#preparation) to get your project set up.
* Installed the Google Cloud SDK and run the following commands in command line: `gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`.
* Installed [Maven](https://maven.apache.org/) and Java 7 (or above).

2. Compile the program by typing `mvn clean compile` in command line.

3. Run the program by typing `mvn exec:java` in command line. In addition to listing tasks via this command line interface, you can view tasks you create in the [Google Cloud Developer's Console](https://console.cloud.google.com/).
65 changes: 65 additions & 0 deletions datastore/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.datastore.snippets</groupId>
<artifactId>datastore-snippets</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>Google Cloud Datastore Snippets</name>
<description>
Example snippets for Datastore concepts and getting started documentation.
</description>
<dependencies>
<dependency>
<groupId>com.google.gcloud</groupId>
<artifactId>gcloud-java-datastore</artifactId>
<version>0.1.3</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
</dependencies>
<build>
<plugins>
<!-- // [START maven]-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<!-- // [END maven]-->
<!-- // [START exec] -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
<configuration>
<mainClass>com.google.datastore.snippets.TaskList</mainClass>
</configuration>
</plugin>
<!-- // [END exec] -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
<configuration>
<configLocation>../google-checks.xml</configLocation>
<consoleOutput>true</consoleOutput>
<failOnViolation>true</failOnViolation>
<failsOnError>true</failsOnError>
</configuration>
<executions>
<execution><goals><goal>check</goal></goals></execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Loading

0 comments on commit 2c88e44

Please sign in to comment.