Skip to content

Commit

Permalink
Docs: Convert to markdown (#193)
Browse files Browse the repository at this point in the history
* Convert assembly readme.html -> README.md and fix links

* Convert and clean dailymotion-cmdline-sample to markdown
  • Loading branch information
chingor13 committed Aug 3, 2018
1 parent ab2fd70 commit 123b055
Show file tree
Hide file tree
Showing 4 changed files with 197 additions and 189 deletions.
129 changes: 129 additions & 0 deletions google-oauth-client-assembly/README.md
@@ -0,0 +1,129 @@
# Google OAuth Client Library for Java

## Overview

High-level details about this library can be found at
https://github.com/google/google-oauth-java-client

* [Release Notes][release-notes]
* [JavaDoc][javadoc]
* [Developer's Guide][developers-guide]
* [Support][support]

## Dependencies and Licenses

The license can be found [here](LICENSE.txt).

Dependent jars can be found in the [libs](libs) folder and the corresponding source jars can be
found in the [libs-sources](libs-sources) folder.

The dependency structure and licenses for the different libraries can be found here:

* [google-oauth-client](dependencies/google-oauth-client-dependencies.html)
* [google-oauth-client-appengine](dependencies/google-oauth-client-appengine-dependencies.html)
* [google-oauth-client-servlet](dependencies/google-oauth-client-servlet-dependencies.html)
* [google-oauth-client-java6](dependencies/google-oauth-client-java6-dependencies.html)
* [google-oauth-client-jetty](dependencies/google-oauth-client-jetty-dependencies.html)
* [google-http-client](dependencies/google-http-client-dependencies.html)
* [google-http-client-android](dependencies/google-http-client-android-dependencies.html)
* [google-http-client-appengine](dependencies/google-http-client-appengine-dependencies.html)
* [google-http-client-protobuf](dependencies/google-http-client-protobuf-dependencies.html)
* [google-http-client-gson](dependencies/google-http-client-gson-dependencies.html)
* [google-http-client-jackson](dependencies/google-http-client-jackson-dependencies.html)
* [google-http-client-jackson2](dependencies/google-http-client-jackson2-dependencies.html)

## Maven Usage

For information on how to add these libraries to your Maven project please see
[Setup Maven][setup-maven].

## Eclipse

A `.classpath` file snippet that can be included in your project's `.classpath` has been provided
[here](.classpath). Please only use the `classpathentry`s you actually need (see below for more
details).

## ProGuard

A ProGuard configuration file [proguard-google-oauth-client.txt](proguard-google-oauth-client.txt)
is included for common settings for using the library. On Android projects, you may want to add a
reference to `proguard-google-oauth-client.txt` in the `project.properties` file under the
`proguard.config` property.

Please read [Setup ProGuard][proguard-setup] for more details.

## Dependencies for all Platforms

The following are the jars from the [libs](libs) folder needed for applications on all platform:

* google-oauth-client-${project.version}.jar
* google-http-client-${project.http.version}.jar
* jsr305-${project.jsr305.version}.jar
* google-http-client-protobuf-${project.http.version}.jar (when using protobuf-java)
* protobuf-java-${project.protobuf-java.version}.jar
* google-http-client-gson-${project.http.version}.jar (when using GSON)
* gson-${project.gson.version}.jar
* google-http-client-jackson-${project.http.version}.jar (when using Jackson)
* jackson-core-asl-${project.jackson-core-asl.version}.jar
* google-http-client-jackson2-${project.http.version}.jar (when using Jackson 2)
* jackson-core-${project.jackson-core2.version}.jar
* google-http-client-xml-${project.version}.jar (when using XML)
* xpp3-${project.xpp3.version}.jar (when NOT on Android)

## Android Dependencies

The following are the jars from the [libs](libs) folder required for Android applications:

* google-http-client-android-${project.http.version}.jar

The libs folder also contains properties files that specify the location of source jars for Android
projects in Eclipse.

Please see the [Setup Android][android-setup] for more details.

## Google App Engine Dependencies

The following are the jars from the [libs](libs) folder required for Google App Engine applications
or a newer compatible version:

* google-oauth-client-appengine-${project.version}.jar
* google-oauth-client-servlet-${project.version}.jar
* google-http-client-appengine-${project.http.version}.jar
* jdo2-api-${project.jdo2-api.version}.jar
* transaction-api-${project.transaction-api.version}.jar

Please see the [Setup Google App Engine][appengine-setup] for more details.

## Servlet Dependencies

The following are the jars from the [libs](libs) folder required for Servlet applications or a newer
compatible version:

* google-oauth-client-servlet-${project.version}.jar
* commons-logging-${project.commons-logging.version}.jar
* httpclient-${project.httpclient.version}.jar
* httpcore-${project.httpcore.version}.jar
* jdo2-api-${project.jdo2-api.version}.jar
* transaction-api-${project.transaction-api.version}.jar

## General Purpose Java 6 Environment Dependencies

The following are the jars from the [libs](libs) folder required for general purpose Java 6
applications or a newer compatible version:

* google-oauth-client-java6-${project.version}.jar (for JDK >= 6)
* google-oauth-client-jetty-${project.version}.jar (for Jetty 6)
* jetty-${project.jetty.version}.jar
* jetty-util-${project.jetty.version}.jar
* commons-logging-${project.commons-logging.version}.jar
* httpclient-${project.httpclient.version}.jar
* httpcore-${project.httpcore.version}.jar

[release-notes]: https://github.com/google/google-oauth-java-client/releases/tag/${project.version}
[javadoc]: https://google.github.io/google-oauth-java-client/releases/${project.version}/javadoc/index.html
[developers-guide]: https://developers.google.com/api-client-library/java/google-oauth-java-client/
[support]: https://developers.google.com/api-client-library/java/google-oauth-java-client/support
[setup-maven]: https://developers.google.com/api-client-library/java/google-oauth-java-client/setup#maven
[proguard-setup]: https://developers.google.com/api-client-library/java/google-http-java-client/setup#proguard
[android-setup]: https://developers.google.com/api-client-library/java/google-http-java-client/setup#android
[appengine-setup]: https://developers.google.com/api-client-library/java/google-oauth-java-client/setup#google_app_engine
2 changes: 1 addition & 1 deletion google-oauth-client-assembly/assembly.xml
Expand Up @@ -21,7 +21,7 @@
<outputDirectory>google-oauth-java-client</outputDirectory>
</file>
<file>
<source>readme.html</source>
<source>README.md</source>
<filtered>true</filtered>
<outputDirectory>google-oauth-java-client</outputDirectory>
</file>
Expand Down
188 changes: 0 additions & 188 deletions google-oauth-client-assembly/readme.html

This file was deleted.

67 changes: 67 additions & 0 deletions samples/dailymotion-cmdline-sample/README.md
@@ -0,0 +1,67 @@
# Instructions for the Daily Motion OAuth2 Command-Line Sample

## Browse Online

[Browse Source][browse-source], or main file [DailyMotionSample.java][main-source].

## Command-Line Instructions

**Prerequisites:** install [Java 6 or higher][install-java], [git][install-git], and
[Maven][install-maven]. You may need to set your `JAVA_HOME`.

1. Check out the sample code:

```bash
git clone https://github.com/google/google-oauth-java-client.git
cd google-oauth-java-client/samples/dailymotion/cmdline-sample

This comment has been minimized.

Copy link
@kilaka

kilaka Sep 17, 2020

Should probably be dailymotion-cmdline-sample, right? (- instead of / between the dailymotion and the cmdline...).

@chingor13

This comment has been minimized.

Copy link
@chingor13

chingor13 Sep 17, 2020

Author Contributor

Thanks for finding this, however, tagging people on old commits is usually missed in notifications. Please open a GitHub issue with these and we can address.

This comment has been minimized.

Copy link
@kilaka

kilaka Sep 18, 2020

Created an issue, including the points below: #499

```

2. Edit the `OAuth2ClientCredentials.java` file with your credentials. To acquire credentials, go
to the [Dailymotion Developer Profile][dailymotion-developer-profile], click "Create New API Key"
and specify "http://127.0.0.1:8080/Callback" as the "Callback URL".

3. Run the sample:

```bash
mvn compile

This comment has been minimized.

Copy link
@kilaka

kilaka Sep 17, 2020

Because of the -SNAPSHOT, the client library needs to be compiled(mvn install) first or else we get the following.
Perhaps state so in the readme?

alik@alik:~/dev/google-oauth-java-client/samples/dailymotion-cmdline-sample$ mvn compile
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 1 modules...
[INFO] Installing Nexus Staging features:
[INFO]   ... total of 1 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
[INFO] 
[INFO] -----< com.google.oauth-client:dailymotion-simple-cmdline-sample >------
[INFO] Building Example for the DailyMotion API using OAuth2. 1.31.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for com.google.oauth-client:google-oauth-client-java6:jar:1.31.1-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for com.google.oauth-client:google-oauth-client-jetty:jar:1.31.1-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for com.google.oauth-client:google-oauth-client:jar:1.31.1-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.639 s
[INFO] Finished at: 2020-09-17T20:09:50Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project dailymotion-simple-cmdline-sample: Could not resolve dependencies for project com.google.oauth-client:dailymotion-simple-cmdline-sample:jar:1.31.1-SNAPSHOT: The following artifacts could not be resolved: com.google.oauth-client:google-oauth-client:jar:1.31.1-SNAPSHOT, com.google.oauth-client:google-oauth-client-java6:jar:1.31.1-SNAPSHOT, com.google.oauth-client:google-oauth-client-jetty:jar:1.31.1-SNAPSHOT: Could not find artifact com.google.oauth-client:google-oauth-client:jar:1.31.1-SNAPSHOT -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

@chingor13

This comment has been minimized.

Copy link
@kilaka

kilaka Sep 17, 2020

After running mvn install from the main folder google-oauth-java-client, compiling the sample worked.

mvn -q exec: java

This comment has been minimized.

Copy link
@kilaka

kilaka Sep 17, 2020

Also, there's a space between exec: and java.
The command doesn't execute. Deleting the space worked.

@chingor13

```

## Setup Project in Eclipse 3.5/3.6

**Prerequisites:** install [Eclipse][install-eclipse], the [git plugin][install-git-plugin], and
[Maven plugin][install-maven-plugin]. You may need to set your `JAVA_HOME`.

1. Setup Eclipse Preferences
* Window > Preferences... (or on Mac, Eclipse > Preferences...)
* Select Maven
* check on "Download Artifact Sources"
* check on "Download Artifact JavaDoc"
2. Import `dailymotion-cmdline-sample` project
* File > Import...
* Select "General > Existing Project into Workspace" and click "Next"
* Click "Browse" next to "Select root directory", find
*someDirectory*/google-oauth-java-client-samples/dailymotion-cmdline-sample and click "Next"
* Click "Finish"
3. Edit the `OAuth2ClientCredentials.java` file with your credentials. To acquire credentials, go
to the [Dailymotion Developer Profile][dailymotion-developer-profile], click "Create New API Key"
and specify "http://127.0.0.1:8080/Callback" as the "Callback URL".
4. Run
* Right-click on project dailymotion-cmdline-sample
* Run As > Java Application
* If asked, type "DailyMotionSample" and click OK
* To enabled logging:
* Run > Run Configurations...
* Click on "Java Application > DailyMotionSample"
* VM arguments: `-Djava.util.logging.config.file=${project_loc}/logging.properties`
* Click "Run"

[browse-source]: https://github.com/google/google-oauth-java-client/tree/dev/samples/dailymotion-cmdline-sample
[main-source]: https://github.com/google/google-oauth-java-client/blob/dev/samples/dailymotion-cmdline-sample/src/main/java/com/google/api/services/samples/dailymotion/cmdline/DailyMotionSample.java
[install-java]: https://java.com/
[install-git]: https://git-scm.com
[install-maven]: https://maven.apache.org
[dailymotion-developer-profile]: https://www.dailymotion.com/profile/developer
[install-eclipse]: https://www.eclipse.org/downloads/
[install-git-plugin]: https://eclipse.org/egit/
[install-maven-plugin]: https://eclipse.org/m2e/

0 comments on commit 123b055

Please sign in to comment.