Browse Source

Mavenize.

Jake Wharton 7 years ago
parent
commit
d8fab22ab2
96 changed files with 763 additions and 1057 deletions
  1. 15
    4
      .gitignore
  2. 0
    3
      .idea/.gitignore
  3. 0
    15
      .idea/ant.xml
  4. 0
    13
      .idea/codeStyleSettings.xml
  5. 0
    24
      .idea/compiler.xml
  6. 0
    5
      .idea/copyright/profiles_settings.xml
  7. 0
    5
      .idea/encodings.xml
  8. 0
    37
      .idea/inspectionProfiles/Project_Default.xml
  9. 0
    7
      .idea/inspectionProfiles/profiles_settings.xml
  10. 0
    15
      .idea/libraries/JARs.xml
  11. 0
    36
      .idea/misc.xml
  12. 0
    13
      .idea/modules.xml
  13. 0
    5
      .idea/scopes/scope_settings.xml
  14. 0
    125
      .idea/uiDesigner.xml
  15. 0
    7
      .idea/vcs.xml
  16. 202
    0
      LICENSE.txt
  17. 0
    53
      README.markdown
  18. 67
    0
      README.md
  19. 1
    1
      android-native/jni/Android.mk
  20. 0
    0
      android-native/jni/retrofit.c
  21. 28
    0
      android-native/pom.xml
  22. 32
    0
      android/pom.xml
  23. 0
    0
      android/src/main/java/retrofit/android/ShakeDetector.java
  24. 1
    1
      android/src/main/java/retrofit/io/QueueFile.java
  25. 11
    4
      android/src/test/java/retrofit/android/ShakeDetectorTest.java
  26. 9
    14
      android/src/test/java/retrofit/io/QueueFileTest.java
  27. 0
    88
      build-macros.xml
  28. 0
    215
      build.xml
  29. 26
    0
      core/pom.xml
  30. 0
    0
      core/src/main/java/retrofit/core/Callback.java
  31. 0
    0
      core/src/main/java/retrofit/core/MainThread.java
  32. 0
    0
      core/src/main/java/retrofit/core/ProgressListener.java
  33. 0
    0
      core/src/main/java/retrofit/core/internal/Objects.java
  34. 6
    3
      core/src/test/java/retrofit/core/internal/ObjectsTest.java
  35. 81
    0
      http/pom.xml
  36. 2
    2
      http/src/main/java/retrofit/http/CallbackResponseHandler.java
  37. 0
    0
      http/src/main/java/retrofit/http/DELETE.java
  38. 1
    1
      http/src/main/java/retrofit/http/Fetcher.java
  39. 0
    0
      http/src/main/java/retrofit/http/GET.java
  40. 2
    2
      http/src/main/java/retrofit/http/GsonResponseHandler.java
  41. 0
    0
      http/src/main/java/retrofit/http/Headers.java
  42. 0
    0
      http/src/main/java/retrofit/http/HttpClients.java
  43. 0
    0
      http/src/main/java/retrofit/http/HttpMethod.java
  44. 0
    0
      http/src/main/java/retrofit/http/HttpMethodType.java
  45. 0
    0
      http/src/main/java/retrofit/http/HttpProfiler.java
  46. 1
    1
      http/src/main/java/retrofit/http/HttpRequestBuilder.java
  47. 0
    0
      http/src/main/java/retrofit/http/POST.java
  48. 0
    0
      http/src/main/java/retrofit/http/PUT.java
  49. 0
    0
      http/src/main/java/retrofit/http/QueryParam.java
  50. 0
    0
      http/src/main/java/retrofit/http/QueryParams.java
  51. 0
    0
      http/src/main/java/retrofit/http/RequestLine.java
  52. 1
    1
      http/src/main/java/retrofit/http/RestAdapter.java
  53. 0
    0
      http/src/main/java/retrofit/http/Server.java
  54. 0
    0
      http/src/main/java/retrofit/http/ServerException.java
  55. 0
    0
      http/src/main/java/retrofit/http/SingleEntity.java
  56. 0
    0
      http/src/main/java/retrofit/http/TypedBytesBody.java
  57. 0
    0
      http/src/main/java/retrofit/http/TypedBytesEntity.java
  58. 0
    0
      http/src/main/java/retrofit/http/UiCallback.java
  59. 0
    0
      http/src/test/java/retrofit/http/DummyHttpClient.java
  60. 1
    1
      http/src/test/java/retrofit/http/FetcherTest.java
  61. 1
    1
      http/src/test/java/retrofit/http/HttpRequestBuilderTest.java
  62. 1
    1
      http/src/test/java/retrofit/http/RestAdapterTest.java
  63. 49
    0
      io/pom.xml
  64. 0
    0
      io/src/main/java/retrofit/io/AbstractTypedBytes.java
  65. 0
    0
      io/src/main/java/retrofit/io/ByteSink.java
  66. 0
    0
      io/src/main/java/retrofit/io/ByteSinks.java
  67. 0
    0
      io/src/main/java/retrofit/io/Files.java
  68. 0
    0
      io/src/main/java/retrofit/io/MimeType.java
  69. 0
    0
      io/src/main/java/retrofit/io/TypedByteArray.java
  70. 0
    0
      io/src/main/java/retrofit/io/TypedBytes.java
  71. 0
    0
      io/src/main/java/retrofit/io/TypedFile.java
  72. 5
    4
      io/src/test/java/retrofit/io/FilesTest.java
  73. 6
    3
      io/src/test/java/retrofit/io/TypedByteArrayTest.java
  74. 7
    4
      io/src/test/java/retrofit/io/TypedFileTest.java
  75. 0
    48
      ivy-build.xml
  76. 0
    24
      ivy-settings.xml
  77. 0
    36
      ivy.xml
  78. 0
    2
      modules/android/.gitignore
  79. 0
    13
      modules/android/README.jni
  80. 0
    14
      modules/android/android.iml
  81. 0
    13
      modules/android/build-jni.sh
  82. BIN
      modules/android/libs/armeabi/libretrofit.so
  83. 0
    3
      modules/android/test_app/.gitignore
  84. 0
    17
      modules/android/test_app/build.properties
  85. 0
    94
      modules/android/test_app/build.xml
  86. 0
    11
      modules/android/test_app/default.properties
  87. 0
    10
      modules/android/test_app/local.properties
  88. 0
    14
      modules/android/test_app/test_app.iml
  89. 0
    14
      modules/core/core.iml
  90. 0
    14
      modules/http/http.iml
  91. 0
    14
      modules/io/io.iml
  92. 161
    0
      pom.xml
  93. 0
    2
      revision.properties
  94. 0
    0
      sample-android/AndroidManifest.xml
  95. 46
    0
      sample-android/pom.xml
  96. 0
    0
      sample-android/src/main/java/retrofit/test_app/Main.java

+ 15
- 4
.gitignore View File

@@ -1,7 +1,18 @@
1
-lib
2
-out
3
-build
4
-
5 1
 .classpath
6 2
 .project
3
+.settings
7 4
 eclipsebin
5
+
6
+bin
7
+gen
8
+
9
+target
10
+pom.xml.*
11
+release.properties
12
+
13
+.idea
14
+*.iml
15
+
16
+obj
17
+
18
+.DS_Store

+ 0
- 3
.idea/.gitignore View File

@@ -1,3 +0,0 @@
1
-workspace.xml
2
-dictionaries/
3
-

+ 0
- 15
.idea/ant.xml View File

@@ -1,15 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project version="4">
3
-  <component name="AntConfiguration">
4
-    <defaultAnt bundledAnt="true" />
5
-    <buildFile url="file://$PROJECT_DIR$/build.xml">
6
-      <additionalClassPath />
7
-      <antReference projectDefault="true" />
8
-      <customJdkName value="" />
9
-      <maximumHeapSize value="128" />
10
-      <maximumStackSize value="2" />
11
-      <properties />
12
-    </buildFile>
13
-  </component>
14
-</project>
15
-

+ 0
- 13
.idea/codeStyleSettings.xml View File

@@ -1,13 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project version="4">
3
-  <component name="ProjectCodeStyleSettingsManager">
4
-    <option name="PER_PROJECT_SETTINGS">
5
-      <value>
6
-        <XML>
7
-          <option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
8
-        </XML>
9
-      </value>
10
-    </option>
11
-  </component>
12
-</project>
13
-

+ 0
- 24
.idea/compiler.xml View File

@@ -1,24 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project version="4">
3
-  <component name="CompilerConfiguration">
4
-    <option name="DEFAULT_COMPILER" value="Javac" />
5
-    <resourceExtensions>
6
-      <entry name=".+\.(properties|xml|html|dtd|tld)" />
7
-      <entry name=".+\.(gif|png|jpeg|jpg)" />
8
-    </resourceExtensions>
9
-    <wildcardResourcePatterns>
10
-      <entry name="?*.properties" />
11
-      <entry name="?*.xml" />
12
-      <entry name="?*.gif" />
13
-      <entry name="?*.png" />
14
-      <entry name="?*.jpeg" />
15
-      <entry name="?*.jpg" />
16
-      <entry name="?*.html" />
17
-      <entry name="?*.dtd" />
18
-      <entry name="?*.tld" />
19
-      <entry name="?*.ftl" />
20
-    </wildcardResourcePatterns>
21
-    <annotationProcessing enabled="false" useClasspath="true" />
22
-  </component>
23
-</project>
24
-

+ 0
- 5
.idea/copyright/profiles_settings.xml View File

@@ -1,5 +0,0 @@
1
-<component name="CopyrightManager">
2
-  <settings default="">
3
-    <module2copyright />
4
-  </settings>
5
-</component>

+ 0
- 5
.idea/encodings.xml View File

@@ -1,5 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project version="4">
3
-  <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
4
-</project>
5
-

+ 0
- 37
.idea/inspectionProfiles/Project_Default.xml View File

@@ -1,37 +0,0 @@
1
-<component name="InspectionProjectProfileManager">
2
-  <profile version="1.0" is_locked="false">
3
-    <option name="myName" value="Project Default" />
4
-    <option name="myLocal" value="false" />
5
-    <inspection_tool class="JavaDoc" enabled="false" level="WARNING" enabled_by_default="false">
6
-      <option name="TOP_LEVEL_CLASS_OPTIONS">
7
-        <value>
8
-          <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
9
-          <option name="REQUIRED_TAGS" value="" />
10
-        </value>
11
-      </option>
12
-      <option name="INNER_CLASS_OPTIONS">
13
-        <value>
14
-          <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
15
-          <option name="REQUIRED_TAGS" value="" />
16
-        </value>
17
-      </option>
18
-      <option name="METHOD_OPTIONS">
19
-        <value>
20
-          <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
21
-          <option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
22
-        </value>
23
-      </option>
24
-      <option name="FIELD_OPTIONS">
25
-        <value>
26
-          <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
27
-          <option name="REQUIRED_TAGS" value="" />
28
-        </value>
29
-      </option>
30
-      <option name="IGNORE_DEPRECATED" value="false" />
31
-      <option name="IGNORE_JAVADOC_PERIOD" value="true" />
32
-      <option name="IGNORE_DUPLICATED_THROWS" value="false" />
33
-      <option name="IGNORE_POINT_TO_ITSELF" value="false" />
34
-      <option name="myAdditionalJavadocTags" value="" />
35
-    </inspection_tool>
36
-  </profile>
37
-</component>

+ 0
- 7
.idea/inspectionProfiles/profiles_settings.xml View File

@@ -1,7 +0,0 @@
1
-<component name="InspectionProjectProfileManager">
2
-  <settings>
3
-    <option name="PROJECT_PROFILE" value="Project Default" />
4
-    <option name="USE_PROJECT_PROFILE" value="true" />
5
-    <version value="1.0" />
6
-  </settings>
7
-</component>

+ 0
- 15
.idea/libraries/JARs.xml View File

@@ -1,15 +0,0 @@
1
-<component name="libraryTable">
2
-  <library name="JARs">
3
-    <CLASSES>
4
-      <root url="file://$PROJECT_DIR$/lib" />
5
-      <root url="jar://$PROJECT_DIR$/build/retrofit-gson-2.1.jar!/" />
6
-    </CLASSES>
7
-    <JAVADOC />
8
-    <SOURCES>
9
-      <root url="jar://$PROJECT_DIR$/lib/junit-4.8.1-sources.jar!/" />
10
-      <root url="jar://$PROJECT_DIR$/lib/android-test-2.2.1-sources.jar!/" />
11
-      <root url="jar://$PROJECT_DIR$/build/retrofit-gson-2.1-sources.jar!/" />
12
-    </SOURCES>
13
-    <jarDirectory url="file://$PROJECT_DIR$/lib" recursive="false" />
14
-  </library>
15
-</component>

+ 0
- 36
.idea/misc.xml View File

@@ -1,36 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project version="4">
3
-  <component name="EntryPointsManager">
4
-    <entry_points version="2.0" />
5
-    <list size="1">
6
-      <item index="0" class="java.lang.String" itemvalue="com.google.inject.Inject" />
7
-    </list>
8
-  </component>
9
-  <component name="JavadocGenerationManager">
10
-    <option name="OUTPUT_DIRECTORY" />
11
-    <option name="OPTION_SCOPE" value="protected" />
12
-    <option name="OPTION_HIERARCHY" value="true" />
13
-    <option name="OPTION_NAVIGATOR" value="true" />
14
-    <option name="OPTION_INDEX" value="true" />
15
-    <option name="OPTION_SEPARATE_INDEX" value="true" />
16
-    <option name="OPTION_DOCUMENT_TAG_USE" value="false" />
17
-    <option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" />
18
-    <option name="OPTION_DOCUMENT_TAG_VERSION" value="false" />
19
-    <option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" />
20
-    <option name="OPTION_DEPRECATED_LIST" value="true" />
21
-    <option name="OTHER_OPTIONS" value="" />
22
-    <option name="HEAP_SIZE" />
23
-    <option name="LOCALE" />
24
-    <option name="OPEN_IN_BROWSER" value="true" />
25
-  </component>
26
-  <component name="ProjectResources">
27
-    <default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
28
-  </component>
29
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
30
-    <output url="file://$PROJECT_DIR$/out" />
31
-  </component>
32
-  <component name="SvnBranchConfigurationManager">
33
-    <option name="mySupportsUserInfoFilter" value="true" />
34
-  </component>
35
-</project>
36
-

+ 0
- 13
.idea/modules.xml View File

@@ -1,13 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project version="4">
3
-  <component name="ProjectModuleManager">
4
-    <modules>
5
-      <module fileurl="file://$PROJECT_DIR$/modules/android/android.iml" filepath="$PROJECT_DIR$/modules/android/android.iml" />
6
-      <module fileurl="file://$PROJECT_DIR$/modules/core/core.iml" filepath="$PROJECT_DIR$/modules/core/core.iml" />
7
-      <module fileurl="file://$PROJECT_DIR$/modules/http/http.iml" filepath="$PROJECT_DIR$/modules/http/http.iml" />
8
-      <module fileurl="file://$PROJECT_DIR$/modules/io/io.iml" filepath="$PROJECT_DIR$/modules/io/io.iml" />
9
-      <module fileurl="file://$PROJECT_DIR$/modules/android/test_app/test_app.iml" filepath="$PROJECT_DIR$/modules/android/test_app/test_app.iml" />
10
-    </modules>
11
-  </component>
12
-</project>
13
-

+ 0
- 5
.idea/scopes/scope_settings.xml View File

@@ -1,5 +0,0 @@
1
-<component name="DependencyValidationManager">
2
-  <state>
3
-    <option name="SKIP_IMPORT_STATEMENTS" value="false" />
4
-  </state>
5
-</component>

+ 0
- 125
.idea/uiDesigner.xml View File

@@ -1,125 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project version="4">
3
-  <component name="Palette2">
4
-    <group name="Swing">
5
-      <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
6
-        <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
7
-      </item>
8
-      <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
9
-        <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
10
-      </item>
11
-      <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
12
-        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
13
-      </item>
14
-      <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
15
-        <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
16
-      </item>
17
-      <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
18
-        <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
19
-        <initial-values>
20
-          <property name="text" value="Button" />
21
-        </initial-values>
22
-      </item>
23
-      <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
24
-        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
25
-        <initial-values>
26
-          <property name="text" value="RadioButton" />
27
-        </initial-values>
28
-      </item>
29
-      <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
30
-        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
31
-        <initial-values>
32
-          <property name="text" value="CheckBox" />
33
-        </initial-values>
34
-      </item>
35
-      <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
36
-        <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
37
-        <initial-values>
38
-          <property name="text" value="Label" />
39
-        </initial-values>
40
-      </item>
41
-      <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
42
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
43
-          <preferred-size width="150" height="-1" />
44
-        </default-constraints>
45
-      </item>
46
-      <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
47
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
48
-          <preferred-size width="150" height="-1" />
49
-        </default-constraints>
50
-      </item>
51
-      <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
52
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
53
-          <preferred-size width="150" height="-1" />
54
-        </default-constraints>
55
-      </item>
56
-      <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
57
-        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
58
-          <preferred-size width="150" height="50" />
59
-        </default-constraints>
60
-      </item>
61
-      <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
62
-        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
63
-          <preferred-size width="150" height="50" />
64
-        </default-constraints>
65
-      </item>
66
-      <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
67
-        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
68
-          <preferred-size width="150" height="50" />
69
-        </default-constraints>
70
-      </item>
71
-      <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
72
-        <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
73
-      </item>
74
-      <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
75
-        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
76
-          <preferred-size width="150" height="50" />
77
-        </default-constraints>
78
-      </item>
79
-      <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
80
-        <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
81
-          <preferred-size width="150" height="50" />
82
-        </default-constraints>
83
-      </item>
84
-      <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
85
-        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
86
-          <preferred-size width="150" height="50" />
87
-        </default-constraints>
88
-      </item>
89
-      <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
90
-        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
91
-          <preferred-size width="200" height="200" />
92
-        </default-constraints>
93
-      </item>
94
-      <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
95
-        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
96
-          <preferred-size width="200" height="200" />
97
-        </default-constraints>
98
-      </item>
99
-      <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
100
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
101
-      </item>
102
-      <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
103
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
104
-      </item>
105
-      <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
106
-        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
107
-      </item>
108
-      <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
109
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
110
-      </item>
111
-      <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
112
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
113
-          <preferred-size width="-1" height="20" />
114
-        </default-constraints>
115
-      </item>
116
-      <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
117
-        <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
118
-      </item>
119
-      <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
120
-        <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
121
-      </item>
122
-    </group>
123
-  </component>
124
-</project>
125
-

+ 0
- 7
.idea/vcs.xml View File

@@ -1,7 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project version="4">
3
-  <component name="VcsDirectoryMappings">
4
-    <mapping directory="" vcs="Git" />
5
-  </component>
6
-</project>
7
-

+ 202
- 0
LICENSE.txt View File

@@ -0,0 +1,202 @@
1
+
2
+                                 Apache License
3
+                           Version 2.0, January 2004
4
+                        http://www.apache.org/licenses/
5
+
6
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+   1. Definitions.
9
+
10
+      "License" shall mean the terms and conditions for use, reproduction,
11
+      and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+      "Licensor" shall mean the copyright owner or entity authorized by
14
+      the copyright owner that is granting the License.
15
+
16
+      "Legal Entity" shall mean the union of the acting entity and all
17
+      other entities that control, are controlled by, or are under common
18
+      control with that entity. For the purposes of this definition,
19
+      "control" means (i) the power, direct or indirect, to cause the
20
+      direction or management of such entity, whether by contract or
21
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+      outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+      "You" (or "Your") shall mean an individual or Legal Entity
25
+      exercising permissions granted by this License.
26
+
27
+      "Source" form shall mean the preferred form for making modifications,
28
+      including but not limited to software source code, documentation
29
+      source, and configuration files.
30
+
31
+      "Object" form shall mean any form resulting from mechanical
32
+      transformation or translation of a Source form, including but
33
+      not limited to compiled object code, generated documentation,
34
+      and conversions to other media types.
35
+
36
+      "Work" shall mean the work of authorship, whether in Source or
37
+      Object form, made available under the License, as indicated by a
38
+      copyright notice that is included in or attached to the work
39
+      (an example is provided in the Appendix below).
40
+
41
+      "Derivative Works" shall mean any work, whether in Source or Object
42
+      form, that is based on (or derived from) the Work and for which the
43
+      editorial revisions, annotations, elaborations, or other modifications
44
+      represent, as a whole, an original work of authorship. For the purposes
45
+      of this License, Derivative Works shall not include works that remain
46
+      separable from, or merely link (or bind by name) to the interfaces of,
47
+      the Work and Derivative Works thereof.
48
+
49
+      "Contribution" shall mean any work of authorship, including
50
+      the original version of the Work and any modifications or additions
51
+      to that Work or Derivative Works thereof, that is intentionally
52
+      submitted to Licensor for inclusion in the Work by the copyright owner
53
+      or by an individual or Legal Entity authorized to submit on behalf of
54
+      the copyright owner. For the purposes of this definition, "submitted"
55
+      means any form of electronic, verbal, or written communication sent
56
+      to the Licensor or its representatives, including but not limited to
57
+      communication on electronic mailing lists, source code control systems,
58
+      and issue tracking systems that are managed by, or on behalf of, the
59
+      Licensor for the purpose of discussing and improving the Work, but
60
+      excluding communication that is conspicuously marked or otherwise
61
+      designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+      "Contributor" shall mean Licensor and any individual or Legal Entity
64
+      on behalf of whom a Contribution has been received by Licensor and
65
+      subsequently incorporated within the Work.
66
+
67
+   2. Grant of Copyright License. Subject to the terms and conditions of
68
+      this License, each Contributor hereby grants to You a perpetual,
69
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+      copyright license to reproduce, prepare Derivative Works of,
71
+      publicly display, publicly perform, sublicense, and distribute the
72
+      Work and such Derivative Works in Source or Object form.
73
+
74
+   3. Grant of Patent License. Subject to the terms and conditions of
75
+      this License, each Contributor hereby grants to You a perpetual,
76
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+      (except as stated in this section) patent license to make, have made,
78
+      use, offer to sell, sell, import, and otherwise transfer the Work,
79
+      where such license applies only to those patent claims licensable
80
+      by such Contributor that are necessarily infringed by their
81
+      Contribution(s) alone or by combination of their Contribution(s)
82
+      with the Work to which such Contribution(s) was submitted. If You
83
+      institute patent litigation against any entity (including a
84
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+      or a Contribution incorporated within the Work constitutes direct
86
+      or contributory patent infringement, then any patent licenses
87
+      granted to You under this License for that Work shall terminate
88
+      as of the date such litigation is filed.
89
+
90
+   4. Redistribution. You may reproduce and distribute copies of the
91
+      Work or Derivative Works thereof in any medium, with or without
92
+      modifications, and in Source or Object form, provided that You
93
+      meet the following conditions:
94
+
95
+      (a) You must give any other recipients of the Work or
96
+          Derivative Works a copy of this License; and
97
+
98
+      (b) You must cause any modified files to carry prominent notices
99
+          stating that You changed the files; and
100
+
101
+      (c) You must retain, in the Source form of any Derivative Works
102
+          that You distribute, all copyright, patent, trademark, and
103
+          attribution notices from the Source form of the Work,
104
+          excluding those notices that do not pertain to any part of
105
+          the Derivative Works; and
106
+
107
+      (d) If the Work includes a "NOTICE" text file as part of its
108
+          distribution, then any Derivative Works that You distribute must
109
+          include a readable copy of the attribution notices contained
110
+          within such NOTICE file, excluding those notices that do not
111
+          pertain to any part of the Derivative Works, in at least one
112
+          of the following places: within a NOTICE text file distributed
113
+          as part of the Derivative Works; within the Source form or
114
+          documentation, if provided along with the Derivative Works; or,
115
+          within a display generated by the Derivative Works, if and
116
+          wherever such third-party notices normally appear. The contents
117
+          of the NOTICE file are for informational purposes only and
118
+          do not modify the License. You may add Your own attribution
119
+          notices within Derivative Works that You distribute, alongside
120
+          or as an addendum to the NOTICE text from the Work, provided
121
+          that such additional attribution notices cannot be construed
122
+          as modifying the License.
123
+
124
+      You may add Your own copyright statement to Your modifications and
125
+      may provide additional or different license terms and conditions
126
+      for use, reproduction, or distribution of Your modifications, or
127
+      for any such Derivative Works as a whole, provided Your use,
128
+      reproduction, and distribution of the Work otherwise complies with
129
+      the conditions stated in this License.
130
+
131
+   5. Submission of Contributions. Unless You explicitly state otherwise,
132
+      any Contribution intentionally submitted for inclusion in the Work
133
+      by You to the Licensor shall be under the terms and conditions of
134
+      this License, without any additional terms or conditions.
135
+      Notwithstanding the above, nothing herein shall supersede or modify
136
+      the terms of any separate license agreement you may have executed
137
+      with Licensor regarding such Contributions.
138
+
139
+   6. Trademarks. This License does not grant permission to use the trade
140
+      names, trademarks, service marks, or product names of the Licensor,
141
+      except as required for reasonable and customary use in describing the
142
+      origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+   7. Disclaimer of Warranty. Unless required by applicable law or
145
+      agreed to in writing, Licensor provides the Work (and each
146
+      Contributor provides its Contributions) on an "AS IS" BASIS,
147
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+      implied, including, without limitation, any warranties or conditions
149
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+      PARTICULAR PURPOSE. You are solely responsible for determining the
151
+      appropriateness of using or redistributing the Work and assume any
152
+      risks associated with Your exercise of permissions under this License.
153
+
154
+   8. Limitation of Liability. In no event and under no legal theory,
155
+      whether in tort (including negligence), contract, or otherwise,
156
+      unless required by applicable law (such as deliberate and grossly
157
+      negligent acts) or agreed to in writing, shall any Contributor be
158
+      liable to You for damages, including any direct, indirect, special,
159
+      incidental, or consequential damages of any character arising as a
160
+      result of this License or out of the use or inability to use the
161
+      Work (including but not limited to damages for loss of goodwill,
162
+      work stoppage, computer failure or malfunction, or any and all
163
+      other commercial damages or losses), even if such Contributor
164
+      has been advised of the possibility of such damages.
165
+
166
+   9. Accepting Warranty or Additional Liability. While redistributing
167
+      the Work or Derivative Works thereof, You may choose to offer,
168
+      and charge a fee for, acceptance of support, warranty, indemnity,
169
+      or other liability obligations and/or rights consistent with this
170
+      License. However, in accepting such obligations, You may act only
171
+      on Your own behalf and on Your sole responsibility, not on behalf
172
+      of any other Contributor, and only if You agree to indemnify,
173
+      defend, and hold each Contributor harmless for any liability
174
+      incurred by, or claims asserted against, such Contributor by reason
175
+      of your accepting any such warranty or additional liability.
176
+
177
+   END OF TERMS AND CONDITIONS
178
+
179
+   APPENDIX: How to apply the Apache License to your work.
180
+
181
+      To apply the Apache License to your work, attach the following
182
+      boilerplate notice, with the fields enclosed by brackets "[]"
183
+      replaced with your own identifying information. (Don't include
184
+      the brackets!)  The text should be enclosed in the appropriate
185
+      comment syntax for the file format. We also recommend that a
186
+      file or class name and description of purpose be included on the
187
+      same "printed page" as the copyright notice for easier
188
+      identification within third-party archives.
189
+
190
+   Copyright [yyyy] [name of copyright owner]
191
+
192
+   Licensed under the Apache License, Version 2.0 (the "License");
193
+   you may not use this file except in compliance with the License.
194
+   You may obtain a copy of the License at
195
+
196
+       http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+   Unless required by applicable law or agreed to in writing, software
199
+   distributed under the License is distributed on an "AS IS" BASIS,
200
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+   See the License for the specific language governing permissions and
202
+   limitations under the License.

+ 0
- 53
README.markdown View File

@@ -1,53 +0,0 @@
1
-# Retrofit
2
-
3
-Reusable Java and Android code from Square, Inc.  
4
-
5
-Modules:
6
-
7
-+    IO: Utility classes for doing low-level java I/O.
8
-+    Http: Abstracts away the messy logic of making network calls (depends on IO).
9
-+    Core: Some interfaces and utilities used by the other retrofit modules.
10
-+    Android: Contains two Android-specific utility classes: ShakeDetector (for detecting device 
11
-shakes) and QueueFile (for storing a queue on the android file-system).
12
-
13
-Note that IntelliJ will complain about compilation errors until you run `ant` (to download all the
14
-dependencies).  This command also generates the .jar files that you'll want to include in your
15
-application.
16
-
17
-
18
-## Http Usage
19
-
20
-Create an interface for your API.  You can create as many of these interfaces as you like.  For 
21
-each interface you create, calling `RestAdapter.service(MyInterface.class)` will create an 
22
-instance of that API handler, which you can then store and use throughout your application.  An 
23
-example interface:
24
-
25
-    public interface DummyService {
26
-      // Produces a url like "foo/bar?id=idValue".
27
-      @GET("foo/bar") 
28
-      void normalGet(@Named("id") String id, Callback<SimpleResponse> callback);
29
-
30
-      // Produces a url like "foo/idValue/bar?category=categoryValue".
31
-      @GET("foo/{id}/bar")
32
-      void getWithPathParam(@Named("id") String id, @Named("category") String category, Callback<SimpleResponse> callback);
33
-
34
-      // Produces a url like "foo/bar/idValue" and body like "id=idValue&body=bodyValue".
35
-      @POST("foo/bar/{id}") 
36
-      void normalPost(@Named("id") String id, @Named("body") String body, Callback<SimpleResponse> callback);
37
-
38
-      // Produces a url like "foo/bar/idValue" and body generated by MyJsonObj.
39
-      @POST("foo/bar/{id}") 
40
-      void singleEntityPost(@SingleEntity MyJsonObj card, @Named("id") String id, Callback<SimpleResponse> callback);
41
-    }
42
-
43
-Note that each method _must_ have a Callback object at the end of the parameter list.  This is how 
44
-your application will handle the results of your network calls: errors and successful responses are 
45
-both handled by the Callback interface.
46
-
47
-If you want to use the @SingleEntity method of specifying request body (see singleEntityPost above), 
48
-your MyJsonObject will need to implement TypedBytes.  For convenience, you can extend 
49
-\GsonRequestEntity if you're just trying to send a JSON string in the request body.
50
-
51
-Also worth noting: for POST/PUT requests using default form encoding for the request entity (see 
52
-normalPost), any path parameters are also included in the request body.  This is different from the 
53
-behavior of GET/DELETE, where path parameters are excluded from the query string.

+ 67
- 0
README.md View File

@@ -0,0 +1,67 @@
1
+Retrofit
2
+========
3
+
4
+Reusable Java and Android code from Square, Inc.
5
+
6
+Modules:
7
+
8
+ *  IO - Utility classes for doing low-level java I/O.
9
+ *  HTTP - Abstracts away the messy logic of making network calls (depends on IO).
10
+ *  Core - Some interfaces and utilities used by the other retrofit modules.
11
+ *  Android - Contains two Android-specific utility classes: `ShakeDetector` (for detecting device
12
+    shakes) and `QueueFile` (for storing a queue on the android file-system).
13
+
14
+
15
+Http Usage
16
+----------
17
+
18
+Create an interface for your API.  You can create as many of these interfaces as you like.  For
19
+each interface you create, calling `RestAdapter.service(MyInterface.class)` will create an
20
+instance of that API handler, which you can then store and use throughout your application.  An
21
+example interface:
22
+
23
+    public interface DummyService {
24
+      // Produces a url like "foo/bar?id=idValue".
25
+      @GET("foo/bar")
26
+      void normalGet(@Named("id") String id, Callback<SimpleResponse> callback);
27
+
28
+      // Produces a url like "foo/idValue/bar?category=categoryValue".
29
+      @GET("foo/{id}/bar")
30
+      void getWithPathParam(@Named("id") String id, @Named("category") String category, Callback<SimpleResponse> callback);
31
+
32
+      // Produces a url like "foo/bar/idValue" and body like "id=idValue&body=bodyValue".
33
+      @POST("foo/bar/{id}")
34
+      void normalPost(@Named("id") String id, @Named("body") String body, Callback<SimpleResponse> callback);
35
+
36
+      // Produces a url like "foo/bar/idValue" and body generated by MyJsonObj.
37
+      @POST("foo/bar/{id}")
38
+      void singleEntityPost(@SingleEntity MyJsonObj card, @Named("id") String id, Callback<SimpleResponse> callback);
39
+    }
40
+
41
+Note that each method _must_ have a `Callback` object at the end of the parameter list.  This is how
42
+your application will handle the results of your network calls: errors and successful responses are
43
+both handled by the `Callback` interface.
44
+
45
+If you want to use the `@SingleEntity` method of specifying request body (see `singleEntityPost` above),
46
+your `MyJsonObject` will need to implement `TypedBytes`.  For convenience, you can extend
47
+`GsonRequestEntity` if you're just trying to send a JSON string in the request body.
48
+
49
+Also worth noting: for POST/PUT requests using default form encoding for the request entity (see
50
+normalPost), any path parameters are also included in the request body.  This is different from the
51
+behavior of GET/DELETE, where path parameters are excluded from the query string.
52
+
53
+
54
+
55
+Compilation
56
+-----------
57
+
58
+Retrofit is built using Maven and there is a very minimal amount of setup required for compilation.
59
+
60
+Two environment variables are required which point to your Android SDK and native Android SDK. A common
61
+place to put these is in a `.bash_profile` file in your home directory.
62
+
63
+    export ANDROID_HOME=~/dev/android-sdk
64
+    export ANDROID_NDK_HOME=~/dev/android-ndk
65
+
66
+With these two environment variables loaded you can compile the modules and sample application by running
67
+`mvn clean verify`. Each module's built artifact will be in its respective `target/` folder.

modules/android/jni/Android.mk → android-native/jni/Android.mk View File

@@ -2,7 +2,7 @@ LOCAL_PATH := $(call my-dir)
2 2
 
3 3
 include $(CLEAR_VARS)
4 4
 
5
-LOCAL_MODULE    := retrofit
5
+LOCAL_MODULE    := retrofit-android-native
6 6
 LOCAL_SRC_FILES := retrofit.c
7 7
 
8 8
 include $(BUILD_SHARED_LIBRARY)

modules/android/jni/retrofit.c → android-native/jni/retrofit.c View File


+ 28
- 0
android-native/pom.xml View File

@@ -0,0 +1,28 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+
3
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
5
+    <modelVersion>4.0.0</modelVersion>
6
+
7
+    <parent>
8
+        <groupId>com.squareup</groupId>
9
+        <artifactId>retrofit</artifactId>
10
+        <version>1.0.0-SNAPSHOT</version>
11
+        <relativePath>../pom.xml</relativePath>
12
+    </parent>
13
+
14
+    <groupId>com.squareup</groupId>
15
+    <artifactId>retrofit-android-native</artifactId>
16
+    <packaging>so</packaging>
17
+    <name>Retrofit Android (Native)</name>
18
+
19
+    <build>
20
+        <plugins>
21
+            <plugin>
22
+                <groupId>com.jayway.maven.plugins.android.generation2</groupId>
23
+                <artifactId>android-maven-plugin</artifactId>
24
+                <extensions>true</extensions>
25
+            </plugin>
26
+        </plugins>
27
+    </build>
28
+</project>

+ 32
- 0
android/pom.xml View File

@@ -0,0 +1,32 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+
3
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
5
+    <modelVersion>4.0.0</modelVersion>
6
+
7
+    <parent>
8
+        <groupId>com.squareup</groupId>
9
+        <artifactId>retrofit</artifactId>
10
+        <version>1.0.0-SNAPSHOT</version>
11
+        <relativePath>../pom.xml</relativePath>
12
+    </parent>
13
+
14
+    <groupId>com.squareup</groupId>
15
+    <artifactId>retrofit-android</artifactId>
16
+    <packaging>jar</packaging>
17
+    <name>Retrofit Android</name>
18
+
19
+    <dependencies>
20
+        <dependency>
21
+            <groupId>com.google.android</groupId>
22
+            <artifactId>android</artifactId>
23
+            <scope>provided</scope>
24
+        </dependency>
25
+
26
+        <dependency>
27
+            <groupId>junit</groupId>
28
+            <artifactId>junit</artifactId>
29
+            <scope>test</scope>
30
+        </dependency>
31
+    </dependencies>
32
+</project>

modules/android/src/retrofit/android/ShakeDetector.java → android/src/main/java/retrofit/android/ShakeDetector.java View File


modules/android/src/retrofit/io/QueueFile.java → android/src/main/java/retrofit/io/QueueFile.java View File

@@ -478,7 +478,7 @@ public class QueueFile {
478 478
   /**
479 479
    * Removes the eldest element.
480 480
    *
481
-   * @throw NoSuchElementException if the queue is empty
481
+   * @throws NoSuchElementException if the queue is empty
482 482
    */
483 483
   public synchronized void remove() throws IOException {
484 484
     if (isEmpty()) throw new NoSuchElementException();

modules/android/src-tests/retrofit/android/ShakeDetectorTest.java → android/src/test/java/retrofit/android/ShakeDetectorTest.java View File

@@ -1,18 +1,25 @@
1 1
 // Copyright 2010 Square, Inc.
2 2
 package retrofit.android;
3 3
 
4
-import junit.framework.TestCase;
5 4
 
6 5
 import java.util.List;
7 6
 
8
-/** @author Eric Burke (eric@squareup.com) */
9
-public class ShakeDetectorTest extends TestCase {
7
+import static org.junit.Assert.assertEquals;
8
+import static org.junit.Assert.assertFalse;
9
+import static org.junit.Assert.assertTrue;
10
+
11
+/**
12
+ * @author Eric Burke (eric@squareup.com)
13
+ */
14
+public class ShakeDetectorTest {
10 15
   public void testInitialShaking() {
11 16
     ShakeDetector.SampleQueue q = new ShakeDetector.SampleQueue();
12 17
     assertFalse("shaking", q.isShaking());
13 18
   }
14 19
 
15
-  /** Tests LG Ally sample rate. */
20
+  /**
21
+   * Tests LG Ally sample rate.
22
+   */
16 23
   public void testShakingSampleCount3() {
17 24
     ShakeDetector.SampleQueue q = new ShakeDetector.SampleQueue();
18 25
 

modules/android/src-tests/retrofit/io/QueueFileTest.java → android/src/test/java/retrofit/io/QueueFileTest.java View File

@@ -1,17 +1,20 @@
1 1
 // Copyright 2010 Square, Inc.
2 2
 package retrofit.io;
3 3
 
4
+import org.junit.After;
5
+import org.junit.Before;
6
+
4 7
 import java.io.File;
5 8
 import java.io.FileNotFoundException;
6 9
 import java.io.IOException;
7 10
 import java.io.InputStream;
8 11
 import java.io.RandomAccessFile;
9
-import java.util.Arrays;
10 12
 import java.util.LinkedList;
11 13
 import java.util.Queue;
12 14
 import java.util.logging.Logger;
13
-import junit.framework.ComparisonFailure;
14
-import junit.framework.TestCase;
15
+
16
+import static org.junit.Assert.assertEquals;
17
+import static org.junit.Assert.fail;
15 18
 
16 19
 /**
17 20
  * Tests for QueueFile.
@@ -19,7 +22,7 @@ import junit.framework.TestCase;
19 22
  * @author Bob Lee (bob@squareup.com)
20 23
  */
21 24
 @SuppressWarnings({"ResultOfMethodCallIgnored"})
22
-public class QueueFileTest extends TestCase {
25
+public class QueueFileTest {
23 26
   private static final Logger logger =
24 27
       Logger.getLogger(QueueFileTest.class.getName());
25 28
 
@@ -41,12 +44,12 @@ public class QueueFileTest extends TestCase {
41 44
 
42 45
   private File file;
43 46
 
44
-  @Override protected void setUp() throws Exception {
47
+  @Before protected void setUp() throws Exception {
45 48
     file = File.createTempFile("test.queue", null);
46 49
     file.delete();
47 50
   }
48 51
 
49
-  @Override protected void tearDown() throws Exception {
52
+  @After protected void tearDown() throws Exception {
50 53
     file.delete();
51 54
   }
52 55
 
@@ -283,14 +286,6 @@ public class QueueFileTest extends TestCase {
283 286
     assertEquals(2, iteration[0]);
284 287
   }
285 288
 
286
-  /** Compares two byte[]s for equality. */
287
-  private static void assertEquals(byte[] expected, byte[] actual) {
288
-    if (!Arrays.equals(expected, actual)) {
289
-      throw new ComparisonFailure(null, Arrays.toString(expected),
290
-          Arrays.toString(actual));
291
-    }
292
-  }
293
-
294 289
   /**
295 290
    * Exercise a bug where wrapped elements were getting corrupted when the
296 291
    * QueueFile was forced to expand in size and a portion of the final Element

+ 0
- 88
build-macros.xml View File

@@ -1,88 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<!-- Copyright 2010 Square, Inc. -->
3
-
4
-<!--
5
-  - Ant macro definitions.
6
-  -->
7
-<project name="Macros" basedir="." default="help">
8
-
9
-  <target name="help">
10
-    <echo>Import this build file into the main build.xml.</echo>
11
-  </target>
12
-
13
-  <!--
14
-    - Compiles a module.
15
-    -->
16
-  <macrodef name="compile.module">
17
-    <attribute name="module"
18
-               description="The directory name under 'modules'."/>
19
-    <element name="compile.main.classpath" optional="true"/>
20
-    <element name="compile.tests.classpath" optional="true"/>
21
-
22
-    <sequential>
23
-      <mkdir dir="${build.dir}/@{module}/main"/>
24
-
25
-      <!-- Compile src/* and place classes in build/[module]/main. -->
26
-      <javac srcdir="modules/@{module}/src"
27
-             destdir="${build.dir}/@{module}/main"
28
-             fork="true"
29
-             debug="true"
30
-             includeantruntime="false">
31
-        <classpath>
32
-          <fileset dir="${lib.dir}" includes="*.jar"/>
33
-          <compile.main.classpath/>
34
-        </classpath>
35
-      </javac>
36
-
37
-      <!-- Compile src-tests/* and place classes in build/[module]/tests. -->
38
-      <mkdir dir="${build.dir}/@{module}/tests"/>
39
-      <javac srcdir="modules/@{module}/src-tests"
40
-             destdir="${build.dir}/@{module}/tests"
41
-             fork="true"
42
-             debug="true"
43
-             includeantruntime="false">
44
-        <classpath>
45
-          <fileset dir="${lib.dir}" includes="*.jar"/>
46
-          <pathelement location="${build.dir}/@{module}/main"/>
47
-          <compile.tests.classpath/>
48
-        </classpath>
49
-      </javac>
50
-    </sequential>
51
-  </macrodef>
52
-
53
-
54
-  <!--
55
-    - Builds a module's JAR file.
56
-    -->
57
-  <macrodef name="jar.module">
58
-    <attribute name="module"
59
-               description="The directory name under 'modules'."/>
60
-    <element name="compile.main.classpath" optional="true"/>
61
-    <element name="compile.tests.classpath" optional="true"/>
62
-
63
-    <sequential>
64
-      <!-- Create the JAR files. -->
65
-      <jar jarfile="${build.dir}/retrofit-@{module}-${retrofit.revision}.jar">
66
-        <manifest>
67
-          <attribute name="Build-Time" value="${build.time}"/>
68
-          <attribute name="Copyright"
69
-                     value="${build.year}, Square, Inc."/>
70
-          <attribute name="Commit-Hash" value="${commit.hash}"/>
71
-        </manifest>
72
-        <fileset dir="${build.dir}/@{module}/main"/>
73
-      </jar>
74
-
75
-      <jar jarfile="${build.dir}/retrofit-@{module}-${retrofit.revision}-src.jar">
76
-        <manifest>
77
-          <attribute name="Build-Time" value="${build.time}"/>
78
-          <attribute name="Copyright"
79
-                     value="${build.year}, Square, Inc."/>
80
-          <attribute name="Commit-Hash" value="${commit.hash}"/>
81
-        </manifest>
82
-        <fileset dir="modules/@{module}/src"/>
83
-      </jar>
84
-    </sequential>
85
-  </macrodef>
86
-
87
-</project>
88
-

+ 0
- 215
build.xml View File

@@ -1,215 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<!-- Copyright 2010 Square, Inc. -->
3
-
4
-<!--
5
-  - Builds the Retrofit project, relying on Apache Ivy to download external
6
-  - dependencies.
7
-  -
8
-  - Retrofit is divided into modules, all of which are built from this single
9
-  - Ant buildfile. The directory structure is as follows:
10
-  -
11
-  -  [project root]
12
-  -    modules
13
-  -      [module]
14
-  -        src
15
-  -        src-tests
16
-  -->
17
-<project
18
-    xmlns:ivy="antlib:org.apache.ivy.ant"
19
-    name="Retrofit" basedir="." default="dist">
20
-
21
-  <!--
22
-    - The Retrofit version number, becomes part of the JAR file names.
23
-    -->
24
-  <property file="revision.properties"/>
25
-
26
-  <!-- Import boilerplate Ivy build steps. -->
27
-  <import file="ivy-build.xml"/>
28
-
29
-  <property name="build.dir" location="build"/>
30
-  <property name="lib.dir" location="lib"/>
31
-
32
-  <property name="testreports.dir" location="${build.dir}/testreports"/>
33
-
34
-  <target name="prepare" depends="init-ivy">
35
-    <tstamp>
36
-      <!-- ISO 8601 format: 2010-06-02T15:25:45Z -->
37
-      <format property="build.time" timezone="GMT"
38
-              pattern="yyyy-MM-dd'T'HH:mm:ss'Z'"/>
39
-      <format property="build.year" timezone="GMT"
40
-              pattern="yyyy"/>
41
-    </tstamp>
42
-
43
-    <!--
44
-      - Assigns the git commit hash to the 'commit.hash' property, sending
45
-      - errors to the Ant log.
46
-      -->
47
-    <exec executable="git"
48
-          outputproperty="commit.hash"
49
-          failifexecutionfails="false"
50
-          logerror="true">
51
-      <arg value="log"/>
52
-      <arg value="-n1"/>
53
-      <arg value="--pretty=format:%H"/>
54
-    </exec>
55
-
56
-    <!-- Downloads dependencies and places JARs under lib. -->
57
-    <ivy:retrieve/>
58
-  </target>
59
-
60
-  <target name="clean">
61
-    <delete dir="${build.dir}"/>
62
-  </target>
63
-
64
-  <target name="clean-libs" depends="clean"
65
-          description="Removes the 'lib' directory.">
66
-    <delete dir="${lib.dir}"/>
67
-  </target>
68
-
69
-  <import file="build-macros.xml"/>
70
-
71
-  <target name="repackage-gson" depends="prepare">
72
-    <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask">
73
-      <classpath>
74
-        <fileset dir="lib" includes="jarjar*.jar"/>
75
-      </classpath>
76
-    </taskdef>
77
-    <jarjar jarfile="${build.dir}/retrofit-gson-2.1.jar">
78
-      <zipfileset src="lib/gson-2.1.jar"/>
79
-      <rule pattern="com.google.gson.**" result="retrofit.internal.gson.@1"/>
80
-    </jarjar>
81
-    <jarjar jarfile="${build.dir}/retrofit-gson-2.1-sources.jar">
82
-      <zipfileset src="lib/gson-2.1-sources.jar"/>
83
-      <rule pattern="com.google.gson.**" result="retrofit.internal.gson.@1"/>
84
-    </jarjar>
85
-  </target>
86
-
87
-  <target name="compile" depends="repackage-gson">
88
-    <!-- Build these in this particular order. -->
89
-    <compile.module module="core"/>
90
-
91
-    <compile.module module="io">
92
-      <compile.main.classpath>
93
-        <pathelement location="${build.dir}/core/main"/>
94
-      </compile.main.classpath>
95
-    </compile.module>
96
-
97
-    <compile.module module="http">
98
-      <compile.main.classpath>
99
-        <pathelement location="${build.dir}/core/main"/>
100
-        <pathelement location="${build.dir}/io/main"/>
101
-	      <pathelement location="${build.dir}/retrofit-gson-2.1.jar"/>
102
-      </compile.main.classpath>
103
-      <compile.tests.classpath>
104
-        <pathelement location="${build.dir}/core/main"/>
105
-        <pathelement location="${build.dir}/io/main"/>
106
-        <pathelement location="${build.dir}/retrofit-gson-2.1.jar"/>
107
-      </compile.tests.classpath>
108
-    </compile.module>
109
-
110
-    <compile.module module="android"/>
111
-  </target>
112
-
113
-  <target name="jar" depends="compile">
114
-    <jar.module module="android"/>
115
-    <jar.module module="core"/>
116
-    <jar.module module="http"/>
117
-    <jar.module module="io"/>
118
-  </target>
119
-
120
-  <target name="require.tests"
121
-          description="Sets a property so test failures abort the build.">
122
-    <property name="require.tests" value="true"/>
123
-  </target>
124
-
125
-  <target name="test" depends="compile" description="Runs tests.">
126
-    <mkdir dir="${testreports.dir}"/>
127
-
128
-    <!--
129
-      - If this property isn't already set, assume broken tests should not
130
-      - abort the build.
131
-      -->
132
-    <property name="require.tests" value="false"/>
133
-
134
-    <junit printsummary="true" haltonfailure="${require.tests}">
135
-      <classpath>
136
-        <pathelement location="${build.dir}/android/main"/>
137
-        <pathelement location="${build.dir}/android/tests"/>
138
-        <pathelement location="${build.dir}/core/main"/>
139
-        <pathelement location="${build.dir}/core/tests"/>
140
-        <pathelement location="${build.dir}/http/main"/>
141
-        <pathelement location="${build.dir}/http/tests"/>
142
-        <pathelement location="${build.dir}/io/main"/>
143
-        <pathelement location="${build.dir}/io/tests"/>
144
-        <fileset dir="${build.dir}" includes="retrofit-gson*.jar"/>
145
-        <fileset dir="${lib.dir}" includes="*.jar"/>
146
-      </classpath>
147
-
148
-      <formatter type="xml"/>
149
-
150
-      <batchtest todir="${testreports.dir}">
151
-        <fileset dir="modules/android/src-tests">
152
-          <include name="**/*Test.java"/>
153
-        </fileset>
154
-        <fileset dir="modules/core/src-tests">
155
-          <include name="**/*Test.java"/>
156
-        </fileset>
157
-        <fileset dir="modules/io/src-tests">
158
-          <include name="**/*Test.java"/>
159
-        </fileset>
160
-        <fileset dir="modules/http/src-tests">
161
-          <include name="**/*Test.java"/>
162
-        </fileset>
163
-      </batchtest>
164
-    </junit>
165
-
166
-    <junitreport todir="${testreports.dir}">
167
-      <fileset dir="${testreports.dir}" includes="TEST-*.xml"/>
168
-
169
-      <report todir="${testreports.dir}"/>
170
-    </junitreport>
171
-
172
-    <echo
173
-        message="${line.separator}Test report written to:${line.separator}${testreports.dir}/index.html"/>
174
-  </target>
175
-
176
-  <!--
177
-    - Publishes to the Ivy repository using the resolver named
178
-    - 'retrofit-resolver'.
179
-    -->
180
-  <target name="publish" depends="dist">
181
-    <ivy:publish
182
-        pubrevision="${retrofit.revision}"
183
-        resolver="retrofit-resolver"
184
-        forcedeliver="true"
185
-        update="true"
186
-        overwrite="true"
187
-        publishivy="true">
188
-      <!--
189
-        - This pattern selects which files will be published. The artifact
190
-        - pattern in ivy-settings.xml controls how the names matched here are
191
-        - published in the Ivy repository.
192
-        -->
193
-      <artifacts pattern="${build.dir}/[artifact]-[revision](-[classifier]).[ext]"/>
194
-    </ivy:publish>
195
-  </target>
196
-
197
-  <target name="dist" depends="clean,require.tests,test,jar"
198
-          description="Compiles, ensures tests pass, and creates all deliverables.">
199
-    <zip zipfile="${build.dir}/retrofit-${retrofit.revision}.zip">
200
-      <zipfileset prefix="retrofit" dir=".">
201
-        <exclude name="build/**"/>
202
-        <exclude name="out/**"/>
203
-        <exclude name="lib/**"/>
204
-        <exclude name="**/.git/**"/>
205
-        <exclude name=".gitignore"/>
206
-        <exclude name=".idea/**"/>
207
-        <exclude name="*.iml"/>
208
-      </zipfileset>
209
-      <zipfileset prefix="retrofit/bin" dir="${build.dir}">
210
-        <include name="retrofit-*.jar"/>
211
-      </zipfileset>
212
-    </zip>
213
-  </target>
214
-</project>
215
-

+ 26
- 0
core/pom.xml View File

@@ -0,0 +1,26 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+
3
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
5
+    <modelVersion>4.0.0</modelVersion>
6
+
7
+    <parent>
8
+        <groupId>com.squareup</groupId>
9
+        <artifactId>retrofit</artifactId>
10
+        <version>1.0.0-SNAPSHOT</version>
11
+        <relativePath>../pom.xml</relativePath>
12
+    </parent>
13
+
14
+    <groupId>com.squareup</groupId>
15
+    <artifactId>retrofit-core</artifactId>
16
+    <packaging>jar</packaging>
17
+    <name>Retrofit Core</name>
18
+
19
+    <dependencies>
20
+        <dependency>
21
+            <groupId>junit</groupId>
22
+            <artifactId>junit</artifactId>
23
+            <scope>test</scope>
24
+        </dependency>
25
+    </dependencies>
26
+</project>

modules/core/src/retrofit/core/Callback.java → core/src/main/java/retrofit/core/Callback.java View File


modules/core/src/retrofit/core/MainThread.java → core/src/main/java/retrofit/core/MainThread.java View File


modules/core/src/retrofit/core/ProgressListener.java → core/src/main/java/retrofit/core/ProgressListener.java View File


modules/core/src/retrofit/core/internal/Objects.java → core/src/main/java/retrofit/core/internal/Objects.java View File


modules/core/src-tests/retrofit/core/internal/ObjectsTest.java → core/src/test/java/retrofit/core/internal/ObjectsTest.java View File

@@ -1,10 +1,13 @@
1 1
 // Copyright 2010 Square, Inc.
2 2
 package retrofit.core.internal;
3 3
 
4
-import junit.framework.TestCase;
4
+import static org.junit.Assert.assertEquals;
5
+import static org.junit.Assert.fail;
5 6
 
6
-/** @author Eric Burke (eric@squareup.com) */
7
-public class ObjectsTest extends TestCase {
7
+/**
8
+ * @author Eric Burke (eric@squareup.com)
9
+ */
10
+public class ObjectsTest {
8 11
   public void testNonNull() {
9 12
     Objects.nonNull(10, "whatever");
10 13
     try {

+ 81
- 0
http/pom.xml View File

@@ -0,0 +1,81 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+
3
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
5
+    <modelVersion>4.0.0</modelVersion>
6
+
7
+    <parent>
8
+        <groupId>com.squareup</groupId>
9
+        <artifactId>retrofit</artifactId>
10
+        <version>1.0.0-SNAPSHOT</version>
11
+        <relativePath>../pom.xml</relativePath>
12
+    </parent>
13
+
14
+    <groupId>com.squareup</groupId>
15
+    <artifactId>retrofit-http</artifactId>
16
+    <packaging>jar</packaging>
17
+    <name>Retrofit HTTP</name>
18
+
19
+    <dependencies>
20
+        <dependency>
21
+            <groupId>com.squareup</groupId>
22
+            <artifactId>retrofit-io</artifactId>
23
+            <version>${project.version}</version>
24
+        </dependency>
25
+        <dependency>
26
+            <groupId>com.google.inject</groupId>
27
+            <artifactId>guice</artifactId>
28
+        </dependency>
29
+        <dependency>
30
+            <groupId>com.google.code.gson</groupId>
31
+            <artifactId>gson</artifactId>
32
+        </dependency>
33
+        <dependency>
34
+            <groupId>org.apache.httpcomponents</groupId>
35
+            <artifactId>httpclient</artifactId>
36
+        </dependency>
37
+        <dependency>
38
+            <groupId>org.apache.httpcomponents</groupId>
39
+            <artifactId>httpmime</artifactId>
40
+        </dependency>
41
+
42
+        <dependency>
43
+            <groupId>junit</groupId>
44
+            <artifactId>junit</artifactId>
45
+            <scope>test</scope>
46
+        </dependency>
47
+        <dependency>
48
+            <groupId>org.easymock</groupId>
49
+            <artifactId>easymock</artifactId>
50
+            <scope>test</scope>
51
+        </dependency>
52
+    </dependencies>
53
+
54
+    <build>
55
+        <plugins>
56
+            <plugin>
57
+                <groupId>org.sonatype.plugins</groupId>
58
+                <artifactId>jarjar-maven-plugin</artifactId>
59
+                <executions>
60
+                    <execution>
61
+                        <phase>package</phase>
62
+                        <goals>
63
+                            <goal>jarjar</goal>
64
+                        </goals>
65
+                        <configuration>
66
+                            <includes>
67
+                                <include>com.google.code.gson:gson</include>
68
+                            </includes>
69
+                            <rules>
70
+                                <rule>
71
+                                    <pattern>com.google.gson.**</pattern>
72
+                                    <result>retrofit.internal.gson.@1</result>
73
+                                </rule>
74
+                            </rules>
75
+                        </configuration>
76
+                    </execution>
77
+                </executions>
78
+            </plugin>
79
+        </plugins>
80
+    </build>
81
+</project>

modules/http/src/retrofit/http/CallbackResponseHandler.java → http/src/main/java/retrofit/http/CallbackResponseHandler.java View File

@@ -5,13 +5,13 @@ import java.io.IOException;
5 5
 import java.util.logging.Level;
6 6
 import java.util.logging.Logger;
7 7
 
8
+import com.google.gson.Gson;
8 9
 import org.apache.http.HttpEntity;
9 10
 import org.apache.http.HttpResponse;
10 11
 import org.apache.http.StatusLine;
11 12
 import org.apache.http.client.ResponseHandler;
12 13
 import org.apache.http.entity.BufferedHttpEntity;
13 14
 import retrofit.core.Callback;
14
-import retrofit.internal.gson.Gson;
15 15
 
16 16
 /**
17 17
  * Support for response handlers that invoke {@link Callback}.
@@ -30,7 +30,7 @@ public abstract class CallbackResponseHandler<T>
30 30
   private static final int GATEWAY_TIMEOUT = 504;
31 31
 
32 32
   private final Callback<T> callback;
33
-  
33
+
34 34
   private final Gson gson;
35 35
 
36 36
   protected CallbackResponseHandler(Gson gson, Callback<T> callback) {

modules/http/src/retrofit/http/DELETE.java → http/src/main/java/retrofit/http/DELETE.java View File


modules/http/src/retrofit/http/Fetcher.java → http/src/main/java/retrofit/http/Fetcher.java View File

@@ -1,6 +1,7 @@
1 1
 // Copyright 2010 Square, Inc.
2 2
 package retrofit.http;
3 3
 
4
+import com.google.gson.Gson;
4 5
 import com.google.inject.Inject;
5 6
 import com.google.inject.Provider;
6 7
 import java.io.IOException;
@@ -14,7 +15,6 @@ import org.apache.http.client.methods.HttpGet;
14 15
 import retrofit.core.Callback;
15 16
 import retrofit.core.MainThread;
16 17
 import retrofit.core.ProgressListener;
17
-import retrofit.internal.gson.Gson;
18 18
 import retrofit.io.ByteSink;
19 19
 
20 20
 import static retrofit.core.internal.Objects.nonNull;

modules/http/src/retrofit/http/GET.java → http/src/main/java/retrofit/http/GET.java View File


modules/http/src/retrofit/http/GsonResponseHandler.java → http/src/main/java/retrofit/http/GsonResponseHandler.java View File

@@ -1,9 +1,9 @@
1 1
 package retrofit.http;
2 2
 
3
+import com.google.gson.Gson;
4
+import com.google.gson.JsonParseException;
3 5
 import org.apache.http.HttpEntity;
4 6
 import retrofit.core.Callback;
5
-import retrofit.internal.gson.Gson;
6
-import retrofit.internal.gson.JsonParseException;
7 7
 
8 8
 import java.io.IOException;
9 9
 import java.io.InputStreamReader;

modules/http/src/retrofit/http/Headers.java → http/src/main/java/retrofit/http/Headers.java View File


modules/http/src/retrofit/http/HttpClients.java → http/src/main/java/retrofit/http/HttpClients.java View File


modules/http/src/retrofit/http/HttpMethod.java → http/src/main/java/retrofit/http/HttpMethod.java View File


modules/http/src/retrofit/http/HttpMethodType.java → http/src/main/java/retrofit/http/HttpMethodType.java View File


modules/http/src/retrofit/http/HttpProfiler.java → http/src/main/java/retrofit/http/HttpProfiler.java View File


modules/http/src/retrofit/http/HttpRequestBuilder.java → http/src/main/java/retrofit/http/HttpRequestBuilder.java View File

@@ -1,10 +1,10 @@
1 1
 package retrofit.http;
2 2
 
3
+import com.google.gson.Gson;
3 4
 import com.google.inject.name.Named;
4 5
 import org.apache.http.NameValuePair;
5 6
 import org.apache.http.client.methods.HttpUriRequest;
6 7
 import org.apache.http.message.BasicNameValuePair;
7
-import retrofit.internal.gson.Gson;
8 8
 import retrofit.io.MimeType;
9 9
 import retrofit.io.TypedBytes;
10 10
 

modules/http/src/retrofit/http/POST.java → http/src/main/java/retrofit/http/POST.java View File


modules/http/src/retrofit/http/PUT.java → http/src/main/java/retrofit/http/PUT.java View File


modules/http/src/retrofit/http/QueryParam.java → http/src/main/java/retrofit/http/QueryParam.java View File


modules/http/src/retrofit/http/QueryParams.java → http/src/main/java/retrofit/http/QueryParams.java View File


modules/http/src/retrofit/http/RequestLine.java → http/src/main/java/retrofit/http/RequestLine.java View File


modules/http/src/retrofit/http/RestAdapter.java → http/src/main/java/retrofit/http/RestAdapter.java View File

@@ -1,5 +1,6 @@
1 1
 package retrofit.http;
2 2
 
3
+import com.google.gson.Gson;
3 4
 import com.google.inject.Binder;
4 5
 import com.google.inject.Inject;
5 6
 import com.google.inject.Module;
@@ -21,7 +22,6 @@ import org.apache.http.client.ResponseHandler;
21 22
 import org.apache.http.client.methods.HttpUriRequest;
22 23
 import retrofit.core.Callback;
23 24
 import retrofit.core.MainThread;
24
-import retrofit.internal.gson.Gson;
25 25
 
26 26
 /**
27 27
  * Converts Java method calls to Rest calls.

modules/http/src/retrofit/http/Server.java → http/src/main/java/retrofit/http/Server.java View File


modules/http/src/retrofit/http/ServerException.java → http/src/main/java/retrofit/http/ServerException.java View File


modules/http/src/retrofit/http/SingleEntity.java → http/src/main/java/retrofit/http/SingleEntity.java View File


modules/http/src/retrofit/http/TypedBytesBody.java → http/src/main/java/retrofit/http/TypedBytesBody.java View File


modules/http/src/retrofit/http/TypedBytesEntity.java → http/src/main/java/retrofit/http/TypedBytesEntity.java View File


modules/http/src/retrofit/http/UiCallback.java → http/src/main/java/retrofit/http/UiCallback.java View File


modules/http/src-tests/retrofit/http/DummyHttpClient.java → http/src/test/java/retrofit/http/DummyHttpClient.java View File


modules/http/src-tests/retrofit/http/FetcherTest.java → http/src/test/java/retrofit/http/FetcherTest.java View File

@@ -1,6 +1,7 @@
1 1
 // Copyright 2010 Square, Inc.
2 2
 package retrofit.http;
3 3
 
4
+import com.google.gson.Gson;
4 5
 import com.google.inject.Provider;
5 6
 import junit.framework.Assert;
6 7
 import junit.framework.TestCase;
@@ -13,7 +14,6 @@ import org.apache.http.client.methods.HttpUriRequest;
13 14
 import retrofit.core.Callback;
14 15
 import retrofit.core.MainThread;
15 16
 import retrofit.core.ProgressListener;
16
-import retrofit.internal.gson.Gson;
17 17
 import retrofit.io.ByteSink;
18 18
 
19 19
 import java.io.ByteArrayOutputStream;

modules/http/src-tests/retrofit/http/HttpRequestBuilderTest.java → http/src/test/java/retrofit/http/HttpRequestBuilderTest.java View File

@@ -1,6 +1,7 @@
1 1
 // Copyright 2011 Square, Inc.
2 2
 package retrofit.http;
3 3
 
4
+import com.google.gson.Gson;
4 5
 import com.google.inject.name.Named;
5 6
 import java.io.ByteArrayOutputStream;
6 7
 import java.lang.reflect.Method;
@@ -13,7 +14,6 @@ import org.apache.http.client.methods.HttpGet;
13 14
 import org.apache.http.client.methods.HttpPut;
14 15
 import org.apache.http.client.methods.HttpUriRequest;
15 16
 import retrofit.core.Callback;
16
-import retrofit.internal.gson.Gson;
17 17
 
18 18
 /** @author Eric Denman (edenman@squareup.com) */
19 19
 public class HttpRequestBuilderTest extends TestCase {

modules/http/src-tests/retrofit/http/RestAdapterTest.java → http/src/test/java/retrofit/http/RestAdapterTest.java View File

@@ -1,5 +1,6 @@
1 1
 package retrofit.http;
2 2
 
3
+import com.google.gson.Gson;
3 4
 import com.google.inject.AbstractModule;
4 5
 import com.google.inject.Guice;
5 6
 import com.google.inject.Injector;
@@ -24,7 +25,6 @@ import org.easymock.IAnswer;
24 25
 import org.junit.Before;
25 26
 import retrofit.core.Callback;
26 27
 import retrofit.core.MainThread;
27
-import retrofit.internal.gson.Gson;
28 28
 
29 29
 import static org.easymock.EasyMock.capture;
30 30
 import static org.easymock.EasyMock.createMock;

+ 49
- 0
io/pom.xml View File

@@ -0,0 +1,49 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+
3
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
5
+    <modelVersion>4.0.0</modelVersion>
6
+
7
+    <parent>
8
+        <groupId>com.squareup</groupId>
9
+        <artifactId>retrofit</artifactId>
10
+        <version>1.0.0-SNAPSHOT</version>
11
+        <relativePath>../pom.xml</relativePath>
12
+    </parent>
13
+
14
+    <groupId>com.squareup</groupId>
15
+    <artifactId>retrofit-io</artifactId>
16
+    <packaging>jar</packaging>
17
+    <name>Retrofit I/O</name>
18
+
19
+    <dependencies>
20
+        <dependency>
21
+            <groupId>com.squareup</groupId>
22
+            <artifactId>retrofit-core</artifactId>
23
+            <version>${project.version}</version>
24
+        </dependency>
25
+        <dependency>
26
+            <groupId>com.squareup</groupId>
27
+            <artifactId>retrofit-android-native</artifactId>
28
+            <version>${project.version}</version>
29
+            <type>so</type>
30
+            <classifier>armeabi</classifier>
31
+        </dependency>
32
+
33
+        <dependency>
34
+            <groupId>junit</groupId>
35
+            <artifactId>junit</artifactId>
36
+            <scope>test</scope>
37
+        </dependency>
38
+    </dependencies>
39
+
40
+    <build>
41
+        <plugins>
42
+            <plugin>
43
+                <groupId>com.jayway.maven.plugins.android.generation2</groupId>
44
+                <artifactId>android-maven-plugin</artifactId>
45
+                <extensions>true</extensions>
46
+            </plugin>
47
+        </plugins>
48
+    </build>
49
+</project>

modules/io/src/retrofit/io/AbstractTypedBytes.java → io/src/main/java/retrofit/io/AbstractTypedBytes.java View File


modules/io/src/retrofit/io/ByteSink.java → io/src/main/java/retrofit/io/ByteSink.java View File


modules/io/src/retrofit/io/ByteSinks.java → io/src/main/java/retrofit/io/ByteSinks.java View File


modules/io/src/retrofit/io/Files.java → io/src/main/java/retrofit/io/Files.java View File


modules/io/src/retrofit/io/MimeType.java → io/src/main/java/retrofit/io/MimeType.java View File


modules/io/src/retrofit/io/TypedByteArray.java → io/src/main/java/retrofit/io/TypedByteArray.java View File


modules/io/src/retrofit/io/TypedBytes.java → io/src/main/java/retrofit/io/TypedBytes.java View File


modules/io/src/retrofit/io/TypedFile.java → io/src/main/java/retrofit/io/TypedFile.java View File


modules/io/src-tests/retrofit/io/FilesTest.java → io/src/test/java/retrofit/io/FilesTest.java View File

@@ -1,17 +1,18 @@
1 1
 // Copyright 2011 Square, Inc.
2 2
 package retrofit.io;
3 3
 
4
-import junit.framework.TestCase;
5
-
6
-import java.io.BufferedWriter;
7 4
 import java.io.File;
8 5
 import java.io.FileWriter;
9 6
 import java.io.PrintWriter;
10 7
 
8
+import static org.junit.Assert.assertFalse;
9
+import static org.junit.Assert.assertTrue;
10
+import static org.junit.Assert.fail;
11
+
11 12
 /**
12 13
  * @author Paul Hawke (psh@squareup.com)
13 14
  */
14
-public class FilesTest extends TestCase {
15
+public class FilesTest {
15 16
   public void testDelete() throws Exception {
16 17
     File tmpFile = File.createTempFile("prefix", ".tmp");
17 18
     PrintWriter pw = new PrintWriter(new FileWriter(tmpFile));

modules/io/src-tests/retrofit/io/TypedByteArrayTest.java → io/src/test/java/retrofit/io/TypedByteArrayTest.java View File

@@ -1,10 +1,13 @@
1 1
 // Copyright 2010 Square, Inc.
2 2
 package retrofit.io;
3 3
 
4
-import junit.framework.TestCase;
4
+import static org.junit.Assert.assertEquals;
5
+import static org.junit.Assert.assertFalse;
5 6
 
6
-/** @author Eric Burke (eric@squareup.com) */
7
-public class TypedByteArrayTest extends TestCase {
7
+/**
8
+ * @author Eric Burke (eric@squareup.com)
9
+ */
10
+public class TypedByteArrayTest {
8 11
   public void testEquals() {
9 12
     TypedByteArray a1 = new TypedByteArray(new byte[]{10, 20}, MimeType.GIF);
10 13
     TypedByteArray a2 = new TypedByteArray(new byte[]{10, 20}, MimeType.GIF);

modules/io/src-tests/retrofit/io/TypedFileTest.java → io/src/test/java/retrofit/io/TypedFileTest.java View File

@@ -1,14 +1,17 @@
1 1
 // Copyright 2010 Square, Inc.
2 2
 package retrofit.io;
3 3
 
4
-import junit.framework.TestCase;
5
-
6 4
 import java.io.File;
7 5
 import java.io.FileOutputStream;
8 6
 import java.io.IOException;
9 7
 
10
-/** @author Eric Burke (eric@squareup.com) */
11
-public class TypedFileTest extends TestCase {
8
+import static org.junit.Assert.assertEquals;
9
+import static org.junit.Assert.assertFalse;
10
+
11
+/**
12
+ * @author Eric Burke (eric@squareup.com)
13
+ */
14
+public class TypedFileTest {
12 15
   public void testNotEquals() {
13 16
     TypedFile a = new TypedFile(new File("a.png"), MimeType.PNG);
14 17
     TypedFile b = new TypedFile(new File("b.png"), MimeType.PNG);

+ 0
- 48
ivy-build.xml View File

@@ -1,48 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<!-- Copyright 2010 Square, Inc. -->
3
-
4
-<!--
5
-  - Ivy boilerplate build steps, helps keep the main buildfile clean.
6
-  -->
7
-<project xmlns:ivy="antlib:org.apache.ivy.ant"
8
-         name="ivy-build" basedir="." default="init-ivy">
9
-
10
-  <property name="ivy.install.version" value="2.2.0"/>
11
-  <condition property="ivy.home" value="${env.IVY_HOME}">
12
-    <isset property="env.IVY_HOME"/>
13
-  </condition>
14
-  <property name="ivy.home" value="${user.home}/.ant"/>
15
-  <property name="ivy.jar.dir" value="${ivy.home}/lib"/>
16
-  <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/>
17
-
18
-  <!--
19
-    - Gets Ivy from the public Maven repo so we don't need a custom Ant
20
-    - installation.
21
-    -->
22
-  <target name="download-ivy" unless="offline">
23
-    <mkdir dir="${ivy.jar.dir}"/>
24
-    <get
25
-        src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
26
-        dest="${ivy.jar.file}" usetimestamp="true"/>
27
-  </target>
28
-
29
-  <target name="init-ivy" depends="download-ivy">
30
-    <!--
31
-      - Try to load ivy here from ivy home, in case the user has not already
32
-      - dropped it into ant's lib dir (note that the latter copy will always
33
-      - take precedence). We will not fail as long as local lib dir exists (it
34
-      - may be empty) and ivy is in at least one of ant's lib dir or the local
35
-      - lib dir.
36
-      -->
37
-    <path id="ivy.lib.path">
38
-      <fileset dir="${ivy.jar.dir}" includes="*.jar"/>
39
-    </path>
40
-
41
-    <taskdef resource="org/apache/ivy/ant/antlib.xml"
42
-             uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
43
-
44
-    <ivy:configure file="ivy-settings.xml"/>
45
-  </target>
46
-
47
-</project>
48
-

+ 0
- 24
ivy-settings.xml View File

@@ -1,24 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<!-- Copyright 2010 Square, Inc. -->
3
-
4
-<!--
5
-  - Configures the Ivy resolver. The Ant build file references this using the
6
-  - <ivy:configure file="ivy-settings.xml"/> tag.
7
-  -
8
-  - @author Eric Burke (eric@squareup.com)
9
-  -->
10
-<ivysettings>
11
-  <settings defaultResolver="retrofit-resolver"/>
12
-  <resolvers>
13
-    <chain name="retrofit-resolver">
14
-      <filesystem name="libraries">
15
-        <!--
16
-          - This pattern controls how artifacts are named when published to
17
-          - the repository.
18
-          -->
19
-        <artifact pattern="${ivy.default.ivy.user.dir}/repository/[artifact]-[revision](-[classifier]).[ext]"/>
20
-      </filesystem>
21
-      <ibiblio name="ibiblio" m2compatible="true"/>
22
-    </chain>
23
-  </resolvers>
24
-</ivysettings>

+ 0
- 36
ivy.xml View File

@@ -1,36 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<!-- Copyright 2010 Square, Inc. -->
3
-
4
-<!--
5
-  - Ivy module file, describing dependencies on other projects.
6
-  -
7
-  - @author Eric Burke (eric@squareup.com)
8
-  -->
9
-<ivy-module
10
-    version="2.0"
11
-    xmlns:e="http://ant.apache.org/ivy/extra"
12
-    >
13
-  <info organisation="com.squareup" module="retrofit"/>
14
-
15
-  <configurations>
16
-    <conf name="android" description="Classes with Android dependencies."/>
17
-  </configurations>
18
-
19
-  <publications>
20
-    <artifact conf="android" name="retrofit-android" ext="jar"/>
21
-    <artifact conf="android" name="retrofit-android" ext="jar" e:classifier="src"/>
22
-  </publications>
23
-
24
-  <!-- Note: find these at http://mvnrepository.com/ -->
25
-  <dependencies>
26
-    <dependency org="com.google.android" name="android-test" rev="2.2.1"/>
27
-    <dependency org="com.google.code.gson" name="gson" rev="2.1"/>
28
-    <dependency org="com.googlecode.jarjar" name="jarjar" rev="1.1"/>
29
-    <dependency org="com.google.code.guice" name="guice" rev="1.0"/>
30
-    <dependency org="org.apache.httpcomponents" name="httpmime" rev="4.1-alpha1"/>
31
-    <dependency org="junit" name="junit" rev="4.8.1"/>
32
-    <dependency org="org.apache.httpcomponents" name="httpclient" rev="4.1-alpha1"/>
33
-    <dependency org="org.easymock" name="easymock" rev="2.5.2"/>
34
-  </dependencies>
35
-
36
-</ivy-module>

+ 0
- 2
modules/android/.gitignore View File

@@ -1,2 +0,0 @@
1
-android-ndk
2
-obj

+ 0
- 13
modules/android/README.jni View File

@@ -1,13 +0,0 @@
1
-The native portions of Retofit's Android module live in ./jni.
2
-
3
-Building:
4
-
5
-  ./build-jni.sh
6
-
7
-Installation:
8
-
9
-  Copy ./libs to your Android project root.
10
-
11
-Testing:
12
-
13
-  Run test_app on a device or emulator.

+ 0
- 14
modules/android/android.iml View File

@@ -1,14 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<module type="JAVA_MODULE" version="4">
3
-  <component name="NewModuleRootManager" inherit-compiler-output="true">
4
-    <exclude-output />
5
-    <content url="file://$MODULE_DIR$">
6
-      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
7
-      <sourceFolder url="file://$MODULE_DIR$/src-tests" isTestSource="true" />
8
-    </content>
9
-    <orderEntry type="inheritedJdk" />
10
-    <orderEntry type="sourceFolder" forTests="false" />
11
-    <orderEntry type="library" name="JARs" level="project" />
12
-  </component>
13
-</module>
14
-

+ 0
- 13
modules/android/build-jni.sh View File

@@ -1,13 +0,0 @@
1
-#!/bin/sh
2
-
3
-if [ ! -d android-ndk ]
4
-then
5
-  echo Downloading Android NDK...
6
-  curl http://dl.google.com/android/ndk/android-ndk-r5b-darwin-x86.tar.bz2 > /tmp/android-ndk.tgz
7
-  echo Extracting Android NDK...
8
-  tar zxf /tmp/android-ndk.tgz -C /tmp
9
-  mv /tmp/android-ndk-r5b ./android-ndk
10
-fi
11
-
12
-./android-ndk/ndk-build
13
-

BIN
modules/android/libs/armeabi/libretrofit.so View File


+ 0
- 3
modules/android/test_app/.gitignore View File

@@ -1,3 +0,0 @@
1
-libs
2
-gen
3
-bin

+ 0
- 17
modules/android/test_app/build.properties View File

@@ -1,17 +0,0 @@
1
-# This file is used to override default values used by the Ant build system.
2
-#
3
-# This file must be checked in Version Control Systems, as it is
4
-# integral to the build system of your project.
5
-
6
-# This file is only used by the Ant script.
7
-
8
-# You can use this to override default values such as
9
-#  'source.dir' for the location of your java source folder and
10
-#  'out.dir' for the location of your output folder.
11
-
12
-# You can also use it define how the release builds are signed by declaring
13
-# the following properties:
14
-#  'key.store' for the location of your keystore and
15
-#  'key.alias' for the name of the key to use.
16
-# The password will be asked during the build when you use the 'release' target.
17
-

+ 0
- 94
modules/android/test_app/build.xml View File

@@ -1,94 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project name="test_app" default="help">
3
-
4
-  <target name="-pre-build">
5
-    <mkdir dir="libs"/>
6
-
7
-    <!-- Copy native library. -->
8
-    <copy todir="libs/armeabi">
9
-      <fileset dir="../libs/armeabi"/>
10
-    </copy>
11
-
12
-    <!-- Copy Retrofit's Java library. -->
13
-    <copy todir="libs">
14
-      <fileset dir="../../../build" includes="retrofit-io*.jar"
15
-          excludes="*src*"/>
16
-    </copy>
17
-  </target>
18
-
19
-<!-- The local.properties file is created and updated by the 'android'
20
-     tool.
21
-     It contains the path to the SDK. It should *NOT* be checked into
22
-     Version Control Systems. -->
23
-    <property file="local.properties" />
24
-
25
-    <!-- The build.properties file can be created by you and is never touched
26
-         by the 'android' tool. This is the place to change some of the
27
-         default property values used by the Ant rules.
28
-         Here are some properties you may want to change/update:
29
-
30
-         source.dir
31
-             The name of the source directory. Default is 'src'.
32
-         out.dir
33
-             The name of the output directory. Default is 'bin'.
34
-
35
-         Properties related to the SDK location or the project target should
36
-         be updated using the 'android' tool with the 'update' action.
37
-
38
-         This file is an integral part of the build system for your
39
-         application and should be checked into Version Control Systems.
40
-
41
-         -->
42
-    <property file="build.properties" />
43
-
44
-    <!-- The default.properties file is created and updated by the 'android'
45
-         tool, as well as ADT.
46
-         This file is an integral part of the build system for your
47
-         application and should be checked into Version Control Systems. -->
48
-    <property file="default.properties" />
49
-
50
-
51
-    <!-- Required pre-setup import -->
52
-    <import file="${sdk.dir}/tools/ant/pre_setup.xml" />
53
-
54
-
55
-<!-- extension targets. Uncomment the ones where you want to do custom work
56
-     in between standard targets -->
57
-<!--
58
-    <target name="-pre-build">
59
-    </target>
60
-    <target name="-pre-compile">
61
-    </target>
62
-
63
-    [This is typically used for code obfuscation.
64
-     Compiled code location: ${out.classes.absolute.dir}
65
-     If this is not done in place, override ${out.dex.input.absolute.dir}]
66
-    <target name="-post-compile">
67
-    </target>
68
--->
69
-
70
-    <!-- Execute the Android Setup task that will setup some properties
71
-         specific to the target, and import the build rules files.
72
-
73
-         The rules file is imported from
74
-            <SDK>/tools/ant/
75
-         Depending on the project type it can be either:
76
-         - main_rules.xml
77
-         - lib_rules.xml
78
-         - test_rules.xml
79
-
80
-         To customize existing targets, there are two options:
81
-         - Customize only one target:
82
-             - copy/paste the target into this file, *before* the
83
-               <setup> task.
84
-             - customize it to your needs.
85
-         - Customize the whole script.
86
-             - copy/paste the content of the rules files (minus the top node)
87
-               into this file, *after* the <setup> task
88
-             - disable the import of the rules by changing the setup task
89
-               below to <setup import="false" />.
90
-             - customize to your needs.
91
-    -->
92
-    <setup />
93
-
94
-</project>

+ 0
- 11
modules/android/test_app/default.properties View File

@@ -1,11 +0,0 @@
1
-# This file is automatically generated by Android Tools.
2
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3
-#
4
-# This file must be checked in Version Control Systems.
5
-#
6
-# To customize properties used by the Ant build system use,
7
-# "build.properties", and override values to adapt the script to your
8
-# project structure.
9
-
10
-# Project target.
11
-target=android-10

+ 0
- 10
modules/android/test_app/local.properties View File

@@ -1,10 +0,0 @@
1
-# This file is automatically generated by Android Tools.
2
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3
-#
4
-# This file must *NOT* be checked in Version Control Systems,
5
-# as it contains information specific to your local configuration.
6
-
7
-# location of the SDK. This is only used by Ant
8
-# For customization when using a Version Control System, please read the
9
-# header note.
10
-sdk.dir=${user.home}/android-sdk

+ 0
- 14
modules/android/test_app/test_app.iml View File

@@ -1,14 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<module type="JAVA_MODULE" version="4">
3
-  <component name="NewModuleRootManager" inherit-compiler-output="true">
4
-    <exclude-output />
5
-    <content url="file://$MODULE_DIR$">
6
-      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
7
-      <sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" />
8
-    </content>
9
-    <orderEntry type="jdk" jdkName="Android" jdkType="JavaSDK" />
10
-    <orderEntry type="sourceFolder" forTests="false" />
11
-    <orderEntry type="module" module-name="io" />
12
-  </component>
13
-</module>
14
-

+ 0
- 14
modules/core/core.iml View File

@@ -1,14 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<module type="JAVA_MODULE" version="4">
3
-  <component name="NewModuleRootManager" inherit-compiler-output="true">
4
-    <exclude-output />
5
-    <content url="file://$MODULE_DIR$">
6
-      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
7
-      <sourceFolder url="file://$MODULE_DIR$/src-tests" isTestSource="true" />
8
-    </content>
9
-    <orderEntry type="inheritedJdk" />
10
-    <orderEntry type="sourceFolder" forTests="false" />
11
-    <orderEntry type="library" exported="" name="JARs" level="project" />
12
-  </component>
13
-</module>
14
-

+ 0
- 14
modules/http/http.iml View File

@@ -1,14 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<module type="JAVA_MODULE" version="4">
3
-  <component name="NewModuleRootManager" inherit-compiler-output="true">
4
-    <exclude-output />
5
-    <content url="file://$MODULE_DIR$">
6
-      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
7
-      <sourceFolder url="file://$MODULE_DIR$/src-tests" isTestSource="true" />
8
-    </content>
9
-    <orderEntry type="inheritedJdk" />
10
-    <orderEntry type="sourceFolder" forTests="false" />
11
-    <orderEntry type="module" module-name="io" exported="" />
12
-  </component>
13
-</module>
14
-

+ 0
- 14
modules/io/io.iml View File

@@ -1,14 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<module type="JAVA_MODULE" version="4">
3
-  <component name="NewModuleRootManager" inherit-compiler-output="true">
4
-    <exclude-output />
5
-    <content url="file://$MODULE_DIR$">
6
-      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
7
-      <sourceFolder url="file://$MODULE_DIR$/src-tests" isTestSource="true" />
8
-    </content>
9
-    <orderEntry type="inheritedJdk" />
10
-    <orderEntry type="sourceFolder" forTests="false" />
11
-    <orderEntry type="module" module-name="core" exported="" />
12
-  </component>
13
-</module>
14
-

+ 161
- 0
pom.xml View File

@@ -0,0 +1,161 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!--
3
+ Copyright (C) 2012 Square, Inc.
4
+
5
+  Licensed under the Apache License, Version 2.0 (the "License");
6
+  you may not use this file except in compliance with the License.
7
+  You may obtain a copy of the License at
8
+
9
+       http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+  Unless required by applicable law or agreed to in writing, software
12
+  distributed under the License is distributed on an "AS IS" BASIS,
13
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+  See the License for the specific language governing permissions and
15
+  limitations under the License.
16
+-->
17
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
19
+    <modelVersion>4.0.0</modelVersion>
20
+
21
+    <groupId>com.squareup</groupId>
22
+    <artifactId>retrofit</artifactId>
23
+    <version>1.0.0-SNAPSHOT</version>
24
+    <packaging>pom</packaging>
25
+
26
+    <name>Retrofit</name>
27
+    <description></description>
28
+    <url>http://github.com/square/retrofit/</url>
29
+
30
+    <modules>
31
+        <module>core</module>
32
+        <module>http</module>
33
+        <module>io</module>
34
+
35
+        <module>android</module>
36
+        <module>android-native</module>
37
+
38
+        <module>sample-android</module>
39
+    </modules>
40
+
41
+    <properties>
42
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
43
+        <project.reporting.sourceEncoding>UTF-8</project.reporting.sourceEncoding>
44
+
45
+        <!-- Compilation -->
46
+        <android-maven.version>3.1.1</android-maven.version>
47
+        <java.version>1.6</java.version>
48
+        <jarjar.version>1.1</jarjar.version>
49
+
50
+        <!-- Dependencies -->
51
+        <android.version>2.2.1</android.version>
52
+        <gson.version>2.1</gson.version>
53
+        <guice.version>3.0</guice.version>
54
+        <httpcomponents.version>4.1.3</httpcomponents.version>
55
+
56
+        <!-- Test Dependencies -->
57
+        <junit.version>4.10</junit.version>
58
+        <easymock.version>3.1</easymock.version>
59
+    </properties>
60
+
61
+    <scm>
62
+        <url>http://github.com/square/retrofit</url>
63
+        <connection>scm:git:git://github.com/square/retrofit.git</connection>
64
+        <developerConnection>scm:git:ssh://git@github.com/square/retrofit.git</developerConnection>
65
+    </scm>
66
+
67
+    <issueManagement>
68
+        <system>GitHub Issues</system>
69
+        <url>http://github.com/square/retrofit/issues</url>
70
+    </issueManagement>
71
+
72
+    <licenses>
73
+        <license>
74
+            <name>Apache 2.0</name>
75
+            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
76
+        </license>
77
+    </licenses>
78
+
79
+    <organization>
80
+        <name>Square, Inc.</name>
81
+        <url>http://squareup.com</url>
82
+    </organization>
83
+
84
+    <dependencyManagement>
85
+        <dependencies>
86
+            <dependency>
87
+                <groupId>com.google.android</groupId>
88
+                <artifactId>android</artifactId>
89
+                <version>${android.version}</version>
90
+            </dependency>
91
+            <dependency>
92
+                <groupId>com.google.code.gson</groupId>
93
+                <artifactId>gson</artifactId>
94
+                <version>${gson.version}</version>
95
+            </dependency>
96
+            <dependency>
97
+                <groupId>com.google.inject</groupId>
98
+                <artifactId>guice</artifactId>
99
+                <version>${guice.version}</version>
100
+            </dependency>
101
+            <dependency>
102
+                <groupId>org.apache.httpcomponents</groupId>
103
+                <artifactId>httpmime</artifactId>
104
+                <version>${httpcomponents.version}</version>
105
+            </dependency>
106
+            <dependency>
107
+                <groupId>org.apache.httpcomponents</groupId>
108
+                <artifactId>httpclient</artifactId>
109
+                <version>${httpcomponents.version}</version>
110
+            </dependency>
111
+
112
+            <dependency>
113
+                <groupId>org.easymock</groupId>
114
+                <artifactId>easymock</artifactId>
115
+                <version>${easymock.version}</version>
116
+            </dependency>
117
+            <dependency>
118
+                <groupId>junit</groupId>
119
+                <artifactId>junit</artifactId>
120
+                <version>${junit.version}</version>
121
+            </dependency>
122
+        </dependencies>
123
+    </dependencyManagement>
124
+
125
+    <build>
126
+        <pluginManagement>
127
+            <plugins>
128
+                <plugin>
129
+                    <groupId>com.jayway.maven.plugins.android.generation2</groupId>
130
+                    <artifactId>android-maven-plugin</artifactId>
131
+                    <version>${android-maven.version}</version>
132
+                </plugin>
133
+
134
+                <plugin>
135
+                    <groupId>org.sonatype.plugins</groupId>
136
+                    <artifactId>jarjar-maven-plugin</artifactId>
137
+                    <version>1.5</version>
138
+                </plugin>
139
+
140
+                <plugin>
141
+                    <groupId>org.apache.maven.plugins</groupId>
142
+                    <artifactId>maven-compiler-plugin</artifactId>
143
+                    <version>2.3.2</version>
144
+                    <configuration>
145
+                        <source>${java.version}</source>
146
+                        <target>${java.version}</target>
147
+                    </configuration>
148
+                </plugin>
149
+            </plugins>
150
+        </pluginManagement>
151
+
152
+        <plugins>
153
+            <plugin>
154
+                <artifactId>maven-release-plugin</artifactId>
155
+                <configuration>
156
+                    <autoVersionSubmodules>true</autoVersionSubmodules>
157
+                </configuration>
158
+            </plugin>
159
+        </plugins>
160
+    </build>
161
+</project>

+ 0
- 2
revision.properties View File

@@ -1,2 +0,0 @@
1
-retrofit.revision=0.6-SNAPSHOT
2
-

modules/android/test_app/AndroidManifest.xml → sample-android/AndroidManifest.xml View File


+ 46
- 0
sample-android/pom.xml View File

@@ -0,0 +1,46 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+
3
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
5
+    <modelVersion>4.0.0</modelVersion>
6
+
7
+    <parent>
8
+        <groupId>com.squareup</groupId>
9
+        <artifactId>retrofit</artifactId>
10
+        <version>1.0.0-SNAPSHOT</version>
11
+        <relativePath>../pom.xml</relativePath>
12
+    </parent>
13
+
14
+    <groupId>com.squareup</groupId>
15
+    <artifactId>retrofit-sample-android</artifactId>
16
+    <packaging>apk</packaging>
17
+    <name>Retrofit Sample: Android</name>
18
+
19
+    <dependencies>
20
+        <dependency>
21
+            <groupId>com.google.android</groupId>
22
+            <artifactId>android</artifactId>
23
+            <scope>provided</scope>
24
+        </dependency>
25
+        <dependency>
26
+            <groupId>com.squareup</groupId>
27
+            <artifactId>retrofit-android</artifactId>
28
+            <version>${project.version}</version>
29
+        </dependency>
30
+        <dependency>
31
+            <groupId>com.squareup</groupId>
32
+            <artifactId>retrofit-io</artifactId>
33
+            <version>${project.version}</version>
34
+        </dependency>
35
+    </dependencies>
36
+
37
+    <build>
38
+        <plugins>
39
+            <plugin>
40
+                <groupId>com.jayway.maven.plugins.android.generation2</groupId>
41
+                <artifactId>android-maven-plugin</artifactId>
42
+                <extensions>true</extensions>
43
+            </plugin>
44
+        </plugins>
45
+    </build>
46
+</project>

modules/android/test_app/src/retrofit/test_app/Main.java → sample-android/src/main/java/retrofit/test_app/Main.java View File


Loading…
Cancel
Save