Skip to content
This repository was archived by the owner on Oct 9, 2018. It is now read-only.

Commit 36992f5

Browse files
committed
Merge pull request #1 from kipanshi/staging
Add Makefile for easy example app compiling and running
2 parents 27a55d8 + 7fd64d3 commit 36992f5

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,10 @@ The usage of this API is ruled by the Terms of Use at:
4848
http://developers.odesk.com/API-Terms-of-Use
4949

5050
## Example
51-
See `example` directory
51+
See the `example` directory. To quickly run the example from the command line:
52+
53+
cd example
54+
make
55+
make run
56+
57+
Make sure you've added consumer key and secret to the `example/odesk.properties`.

example/HOWTO

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,9 @@
1414
You can also overwrite super class Config and use your own as a parameter for OAuthClient constructor,
1515
in that way, keys can be stored elsewhere.
1616
7. See TestApi.java example to build a simple application that uses oDesk API.
17+
18+
Some steps from the above are automated already in the `Makefile`, so to run the `TestApi.java`
19+
example app you can just use:
20+
21+
make
22+
make run

example/Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Makefile for oDesk API java example
2+
#
3+
4+
SRC_PATH = src
5+
SRC_NAME = TestApi
6+
SRC = $(SRC_PATH)/$(SRC_NAME).java
7+
LIB_DIR = ./../lib
8+
CLASSPATH = "$(LIB_DIR)/httpcomponents-client-4.3.3/httpcore-4.3.2.jar:$(LIB_DIR)/httpcomponents-client-4.3.3/httpclient-4.3.3.jar:$(LIB_DIR)/httpcomponents-client-4.3.3/commons-codec-1.6.jar:$(LIB_DIR)/httpcomponents-client-4.3.3/commons-logging-1.1.3.jar:$(LIB_DIR)/signpost-1.2.1.2/signpost-core-1.2.1.2.jar:$(LIB_DIR)/signpost-1.2.1.2/signpost-commonshttp4-1.2.1.2.jar:$(LIB_DIR)/java-json.jar:$(LIB_DIR)/java-odesk.jar:./$(SRC_PATH)"
9+
10+
compile :
11+
javac -cp $(CLASSPATH) $(SRC)
12+
13+
run :
14+
java -cp $(CLASSPATH) $(SRC_NAME)

0 commit comments

Comments
 (0)