Permalink
Browse files

Reorganize project for a final push toward 1.0.

* Bump version to 1.0.0-SNAPSHOT.
* Conslidate 'http' and 'io' modules into a single 'retrofit' module.
* Remove native directory sync code and example.
* Renames 'examples' to 'samples'.
  • Loading branch information...
1 parent 517b208 commit 06d449fa1e6ebbd81c807fb62dfcde76cf58e7ae @JakeWharton JakeWharton committed Oct 29, 2012
Showing with 40 additions and 342 deletions.
  1. +0 −10 .travis.yml
  2. +16 −18 README.md
  3. +0 −15 examples/directory-sync/AndroidManifest.xml
  4. +0 −45 examples/directory-sync/pom.xml
  5. +0 −35 examples/directory-sync/src/main/java/retrofit/test_app/Main.java
  6. +0 −44 io/pom.xml
  7. +7 −10 pom.xml
  8. +5 −10 {http → retrofit}/pom.xml
  9. 0 {http → retrofit}/src/main/java/retrofit/android/AndroidMainThread.java
  10. 0 {http → retrofit}/src/main/java/retrofit/http/Callback.java
  11. 0 {http → retrofit}/src/main/java/retrofit/http/CallbackRunnable.java
  12. 0 {http → retrofit}/src/main/java/retrofit/http/ConversionException.java
  13. 0 {http → retrofit}/src/main/java/retrofit/http/Converter.java
  14. 0 {http → retrofit}/src/main/java/retrofit/http/DELETE.java
  15. 0 {http → retrofit}/src/main/java/retrofit/http/GET.java
  16. 0 {http → retrofit}/src/main/java/retrofit/http/GsonConverter.java
  17. 0 {http → retrofit}/src/main/java/retrofit/http/Headers.java
  18. 0 {http → retrofit}/src/main/java/retrofit/http/HttpMethod.java
  19. 0 {http → retrofit}/src/main/java/retrofit/http/HttpMethodType.java
  20. 0 {http → retrofit}/src/main/java/retrofit/http/HttpProfiler.java
  21. 0 {http → retrofit}/src/main/java/retrofit/http/HttpRequestBuilder.java
  22. 0 {http → retrofit}/src/main/java/retrofit/http/MainThread.java
  23. 0 {http → retrofit}/src/main/java/retrofit/http/POST.java
  24. 0 {http → retrofit}/src/main/java/retrofit/http/PUT.java
  25. 0 {http → retrofit}/src/main/java/retrofit/http/QueryParam.java
  26. 0 {http → retrofit}/src/main/java/retrofit/http/QueryParams.java
  27. 0 {http → retrofit}/src/main/java/retrofit/http/RequestLine.java
  28. 0 {http → retrofit}/src/main/java/retrofit/http/RestAdapter.java
  29. 0 {http → retrofit}/src/main/java/retrofit/http/RestException.java
  30. 0 {http → retrofit}/src/main/java/retrofit/http/Server.java
  31. 0 {http → retrofit}/src/main/java/retrofit/http/SingleEntity.java
  32. 0 {http → retrofit}/src/main/java/retrofit/http/TypedBytesBody.java
  33. 0 {http → retrofit}/src/main/java/retrofit/http/TypedBytesEntity.java
  34. 0 {http → retrofit}/src/main/java/retrofit/http/Types.java
  35. 0 {io → retrofit}/src/main/java/retrofit/io/AbstractTypedBytes.java
  36. 0 {io → retrofit}/src/main/java/retrofit/io/MimeType.java
  37. 0 {io → retrofit}/src/main/java/retrofit/io/TypedByteArray.java
  38. 0 {io → retrofit}/src/main/java/retrofit/io/TypedBytes.java
  39. 0 {io → retrofit}/src/main/java/retrofit/io/TypedFile.java
  40. 0 {http → retrofit}/src/test/java/retrofit/http/DummyHttpClient.java
  41. 0 {http → retrofit}/src/test/java/retrofit/http/HttpRequestBuilderTest.java
  42. 0 {http → retrofit}/src/test/java/retrofit/http/RestAdapterTest.java
  43. 0 {io → retrofit}/src/test/java/retrofit/io/TypedByteArrayTest.java
  44. 0 {io → retrofit}/src/test/java/retrofit/io/TypedFileTest.java
  45. +5 −6 {examples → samples}/pom.xml
  46. +7 −7 {examples → samples}/twitter-client/pom.xml
  47. 0 {examples → samples}/twitter-client/src/main/java/com/squareup/retrofit/example/twitter/Client.java
  48. +0 −8 sync-native/jni/Android.mk
  49. +0 −30 sync-native/jni/retrofit.c
  50. +0 −27 sync-native/pom.xml
  51. +0 −45 sync/pom.xml
  52. +0 −32 sync/src/main/java/retrofit/io/Dirs.java
View
@@ -6,13 +6,3 @@ branches:
notifications:
email: false
-
-before_install:
- - wget http://dl.google.com/android/android-sdk_r20.0.3-linux.tgz
- - tar -zxf android-sdk_r20.0.3-linux.tgz
- - export ANDROID_HOME=~/builds/square/retrofit/android-sdk-linux
- - wget http://dl.google.com/android/ndk/android-ndk-r8b-linux-x86.tar.bz2
- - tar -jxf android-ndk-r8b-linux-x86.tar.bz2
- - export ANDROID_NDK_HOME=~/builds/square/retrofit/android-ndk-r8b
- - export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_NDK_HOME}
- - android update sdk --filter 1,3 --no-ui --force
View
@@ -1,17 +1,11 @@
Retrofit
========
-Reusable Java and Android code from Square, Inc.
+Type-safe REST client for Android and Java by Square, Inc.
-Modules:
- * http - Abstracts away the messy logic of making network calls (depends on 'io').
- * io - Utility classes for doing low-level java I/O.
- * sync - Directory write synchronization.
-
-
-Http Usage
-----------
+Usage
+-----
Create an interface for your API. You can create as many of these interfaces as you like. For
each interface you create, calling `RestAdapter.create(MyInterface.class)` will create an
@@ -60,16 +54,20 @@ behavior of GET/DELETE, where path parameters are excluded from the query string
-Compilation
------------
-Retrofit is built using Maven and there is a very minimal amount of setup required for compilation.
+License
+=======
+
+ Copyright 2012 Square, Inc.
-Two environment variables are required which point to your Android SDK and native Android SDK. A common
-place to put these is in a `.bash_profile` file in your home directory.
+ 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
- export ANDROID_HOME=~/dev/android-sdk
- export ANDROID_NDK_HOME=~/dev/android-ndk
+ http://www.apache.org/licenses/LICENSE-2.0
-With these two environment variables loaded you can compile the modules and sample application by running
-`mvn clean verify`. Each module's built artifact will be in its respective `target/` folder.
+ 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.
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="retrofit.test_app"
- android:versionCode="1"
- android:versionName="1.0">
- <application android:label="Test Retrofit">
- <activity android:name="Main"
- android:label="Test Retrofit">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-</manifest>
@@ -1,45 +0,0 @@
-<?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/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>com.squareup</groupId>
- <artifactId>retrofit-examples</artifactId>
- <version>0.8.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>retrofit-example-directory-sync</artifactId>
- <packaging>apk</packaging>
- <name>Example: Directory Sync</name>
-
- <dependencies>
- <dependency>
- <groupId>com.google.android</groupId>
- <artifactId>android</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.squareup</groupId>
- <artifactId>retrofit-sync</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>com.jayway.maven.plugins.android.generation2</groupId>
- <artifactId>android-maven-plugin</artifactId>
- <extensions>true</extensions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-</project>
@@ -1,35 +0,0 @@
-package retrofit.test_app;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.widget.TextView;
-import retrofit.io.Dirs;
-
-import java.io.File;
-import java.io.IOException;
-
-public class Main extends Activity {
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- TextView result = new TextView(this);
-
- try {
- File dir = getFilesDir();
- Dirs.sync(dir);
- } catch (IOException e) {
- throw new AssertionError(e);
- }
-
- try {
- File file = new File(getFilesDir(), "not-a-dir");
- file.createNewFile();
- Dirs.sync(file);
- throw new AssertionError("Expected an IOException.");
- } catch (IOException e) { /* expected */ }
-
- result.setText("OK");
- setContentView(result);
- }
-}
View
@@ -1,44 +0,0 @@
-<?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/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>com.squareup</groupId>
- <artifactId>retrofit</artifactId>
- <version>0.8.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>retrofit-io</artifactId>
- <name>I/O</name>
-
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.easytesting</groupId>
- <artifactId>fest-assert-core</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>com.jayway.maven.plugins.android.generation2</groupId>
- <artifactId>android-maven-plugin</artifactId>
- <extensions>true</extensions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-</project>
View
@@ -24,21 +24,18 @@
<version>7</version>
</parent>
- <groupId>com.squareup</groupId>
- <artifactId>retrofit</artifactId>
- <version>0.8.0-SNAPSHOT</version>
+ <groupId>com.squareup.retrofit</groupId>
+ <artifactId>parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
- <name>Retrofit</name>
- <description>Reusable Java and Android code from Square, Inc. for simplified I/O, HTTP, and more.</description>
+ <name>Retrofit (Parent)</name>
+ <description>Type-safe REST client for Android and Java by Square, Inc.</description>
<url>http://github.com/square/retrofit/</url>
<modules>
- <module>examples</module>
- <module>http</module>
- <module>io</module>
- <module>sync</module>
- <module>sync-native</module>
+ <module>retrofit</module>
+ <module>samples</module>
</modules>
<properties>
@@ -5,22 +5,17 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>com.squareup</groupId>
- <artifactId>retrofit</artifactId>
- <version>0.8.0-SNAPSHOT</version>
+ <groupId>com.squareup.retrofit</groupId>
+ <artifactId>parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
- <artifactId>retrofit-http</artifactId>
- <name>HTTP</name>
+ <artifactId>retrofit</artifactId>
+ <name>Retrofit</name>
<dependencies>
<dependency>
- <groupId>com.squareup</groupId>
- <artifactId>retrofit-io</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</dependency>
@@ -8,18 +8,17 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>com.squareup</groupId>
- <artifactId>retrofit</artifactId>
- <version>0.8.0-SNAPSHOT</version>
+ <groupId>com.squareup.retrofit</groupId>
+ <artifactId>parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
- <artifactId>retrofit-examples</artifactId>
- <name>Examples</name>
+ <artifactId>samples</artifactId>
+ <name>Samples</name>
<packaging>pom</packaging>
<modules>
- <module>directory-sync</module>
<module>twitter-client</module>
</modules>
</project>
@@ -9,15 +9,15 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>com.squareup</groupId>
- <artifactId>retrofit-examples</artifactId>
- <version>0.8.0-SNAPSHOT</version>
+ <groupId>com.squareup.retrofit</groupId>
+ <artifactId>samples</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
- <artifactId>retrofit-example-twitter-client</artifactId>
+ <artifactId>sample-twitter-client</artifactId>
<packaging>jar</packaging>
- <name>Example: Twitter Client</name>
+ <name>Sample: Twitter Client</name>
<dependencies>
<dependency>
@@ -26,8 +26,8 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>com.squareup</groupId>
- <artifactId>retrofit-http</artifactId>
+ <groupId>com.squareup.retrofit</groupId>
+ <artifactId>retrofit</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
@@ -1,8 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := retrofit-sync-native
-LOCAL_SRC_FILES := retrofit.c
-
-include $(BUILD_SHARED_LIBRARY)
@@ -1,30 +0,0 @@
-#include <string.h>
-#include <jni.h>
-#include <errno.h>
-#include <fcntl.h>
-
-static void throwException(JNIEnv* env, const char* typeName,
- const char* message) {
- (*env)->ThrowNew(env, (*env)->FindClass(env, typeName), message);
-}
-
-void Java_retrofit_io_Native_sync(JNIEnv* env, jclass javaType,
- jstring javaPath) {
- const char* path = (*env)->GetStringUTFChars(env, javaPath, NULL);
- // assert path != NULL
-
- // Returns an error if path doesn't reference a directory.
- int fd = open(path, O_RDONLY | O_DIRECTORY);
-
- (*env)->ReleaseStringUTFChars(env, javaPath, path);
-
- if (fd == -1) goto io_error;
- if (fsync(fd) == -1) goto io_error;
- if (close(fd) == -1) goto io_error;
-
- return;
-
-io_error:
- throwException(env, "java/io/IOException", strerror(errno));
- return;
-}
View
@@ -1,27 +0,0 @@
-<?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/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>com.squareup</groupId>
- <artifactId>retrofit</artifactId>
- <version>0.8.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>retrofit-sync-native</artifactId>
- <packaging>so</packaging>
- <name>Directory Sync Native</name>
-
- <build>
- <plugins>
- <plugin>
- <groupId>com.jayway.maven.plugins.android.generation2</groupId>
- <artifactId>android-maven-plugin</artifactId>
- <extensions>true</extensions>
- </plugin>
- </plugins>
- </build>
-</project>
Oops, something went wrong. Retry.

0 comments on commit 06d449f

Please sign in to comment.