Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Mavenize.

  • Loading branch information...
commit d8fab22ab289f24caf73e2af9d486b92afdad490 1 parent b0241b3
@JakeWharton JakeWharton authored
Showing with 763 additions and 1,057 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  {modules/android → android-native}/jni/Android.mk
  20. 0  {modules/android → android-native}/jni/retrofit.c
  21. +28 −0 android-native/pom.xml
  22. +32 −0 android/pom.xml
  23. 0  {modules/android/src → android/src/main/java}/retrofit/android/ShakeDetector.java
  24. +1 −1  {modules/android/src → android/src/main/java}/retrofit/io/QueueFile.java
  25. +11 −4 {modules/android/src-tests → android/src/test/java}/retrofit/android/ShakeDetectorTest.java
  26. +9 −14 {modules/android/src-tests → 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  {modules/core/src → core/src/main/java}/retrofit/core/Callback.java
  31. 0  {modules/core/src → core/src/main/java}/retrofit/core/MainThread.java
  32. 0  {modules/core/src → core/src/main/java}/retrofit/core/ProgressListener.java
  33. 0  {modules/core/src → core/src/main/java}/retrofit/core/internal/Objects.java
  34. +6 −3 {modules/core/src-tests → core/src/test/java}/retrofit/core/internal/ObjectsTest.java
  35. +81 −0 http/pom.xml
  36. +2 −2 {modules/http/src → http/src/main/java}/retrofit/http/CallbackResponseHandler.java
  37. 0  {modules/http/src → http/src/main/java}/retrofit/http/DELETE.java
  38. +1 −1  {modules/http/src → http/src/main/java}/retrofit/http/Fetcher.java
  39. 0  {modules/http/src → http/src/main/java}/retrofit/http/GET.java
  40. +2 −2 {modules/http/src → http/src/main/java}/retrofit/http/GsonResponseHandler.java
  41. 0  {modules/http/src → http/src/main/java}/retrofit/http/Headers.java
  42. 0  {modules/http/src → http/src/main/java}/retrofit/http/HttpClients.java
  43. 0  {modules/http/src → http/src/main/java}/retrofit/http/HttpMethod.java
  44. 0  {modules/http/src → http/src/main/java}/retrofit/http/HttpMethodType.java
  45. 0  {modules/http/src → http/src/main/java}/retrofit/http/HttpProfiler.java
  46. +1 −1  {modules/http/src → http/src/main/java}/retrofit/http/HttpRequestBuilder.java
  47. 0  {modules/http/src → http/src/main/java}/retrofit/http/POST.java
  48. 0  {modules/http/src → http/src/main/java}/retrofit/http/PUT.java
  49. 0  {modules/http/src → http/src/main/java}/retrofit/http/QueryParam.java
  50. 0  {modules/http/src → http/src/main/java}/retrofit/http/QueryParams.java
  51. 0  {modules/http/src → http/src/main/java}/retrofit/http/RequestLine.java
  52. +1 −1  {modules/http/src → http/src/main/java}/retrofit/http/RestAdapter.java
  53. 0  {modules/http/src → http/src/main/java}/retrofit/http/Server.java
  54. 0  {modules/http/src → http/src/main/java}/retrofit/http/ServerException.java
  55. 0  {modules/http/src → http/src/main/java}/retrofit/http/SingleEntity.java
  56. 0  {modules/http/src → http/src/main/java}/retrofit/http/TypedBytesBody.java
  57. 0  {modules/http/src → http/src/main/java}/retrofit/http/TypedBytesEntity.java
  58. 0  {modules/http/src → http/src/main/java}/retrofit/http/UiCallback.java
  59. 0  {modules/http/src-tests → http/src/test/java}/retrofit/http/DummyHttpClient.java
  60. +1 −1  {modules/http/src-tests → http/src/test/java}/retrofit/http/FetcherTest.java
  61. +1 −1  {modules/http/src-tests → http/src/test/java}/retrofit/http/HttpRequestBuilderTest.java
  62. +1 −1  {modules/http/src-tests → http/src/test/java}/retrofit/http/RestAdapterTest.java
  63. +49 −0 io/pom.xml
  64. 0  {modules/io/src → io/src/main/java}/retrofit/io/AbstractTypedBytes.java
  65. 0  {modules/io/src → io/src/main/java}/retrofit/io/ByteSink.java
  66. 0  {modules/io/src → io/src/main/java}/retrofit/io/ByteSinks.java
  67. 0  {modules/io/src → io/src/main/java}/retrofit/io/Files.java
  68. 0  {modules/io/src → io/src/main/java}/retrofit/io/MimeType.java
  69. 0  {modules/io/src → io/src/main/java}/retrofit/io/TypedByteArray.java
  70. 0  {modules/io/src → io/src/main/java}/retrofit/io/TypedBytes.java
  71. 0  {modules/io/src → io/src/main/java}/retrofit/io/TypedFile.java
  72. +5 −4 {modules/io/src-tests → io/src/test/java}/retrofit/io/FilesTest.java
  73. +6 −3 {modules/io/src-tests → io/src/test/java}/retrofit/io/TypedByteArrayTest.java
  74. +7 −4 {modules/io/src-tests → 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  {modules/android/test_app → sample-android}/AndroidManifest.xml
  95. +46 −0 sample-android/pom.xml
  96. 0  {modules/android/test_app/src → sample-android/src/main/java}/retrofit/test_app/Main.java
View
19 .gitignore
@@ -1,7 +1,18 @@
-lib
-out
-build
-
.classpath
.project
+.settings
eclipsebin
+
+bin
+gen
+
+target
+pom.xml.*
+release.properties
+
+.idea
+*.iml
+
+obj
+
+.DS_Store
View
3  .idea/.gitignore
@@ -1,3 +0,0 @@
-workspace.xml
-dictionaries/
-
View
15 .idea/ant.xml
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
- <component name="AntConfiguration">
- <defaultAnt bundledAnt="true" />
- <buildFile url="file://$PROJECT_DIR$/build.xml">
- <additionalClassPath />
- <antReference projectDefault="true" />
- <customJdkName value="" />
- <maximumHeapSize value="128" />
- <maximumStackSize value="2" />
- <properties />
- </buildFile>
- </component>
-</project>
-
View
13 .idea/codeStyleSettings.xml
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
- <component name="ProjectCodeStyleSettingsManager">
- <option name="PER_PROJECT_SETTINGS">
- <value>
- <XML>
- <option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
- </XML>
- </value>
- </option>
- </component>
-</project>
-
View
24 .idea/compiler.xml
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
- <component name="CompilerConfiguration">
- <option name="DEFAULT_COMPILER" value="Javac" />
- <resourceExtensions>
- <entry name=".+\.(properties|xml|html|dtd|tld)" />
- <entry name=".+\.(gif|png|jpeg|jpg)" />
- </resourceExtensions>
- <wildcardResourcePatterns>
- <entry name="?*.properties" />
- <entry name="?*.xml" />
- <entry name="?*.gif" />
- <entry name="?*.png" />
- <entry name="?*.jpeg" />
- <entry name="?*.jpg" />
- <entry name="?*.html" />
- <entry name="?*.dtd" />
- <entry name="?*.tld" />
- <entry name="?*.ftl" />
- </wildcardResourcePatterns>
- <annotationProcessing enabled="false" useClasspath="true" />
- </component>
-</project>
-
View
5 .idea/copyright/profiles_settings.xml
@@ -1,5 +0,0 @@
-<component name="CopyrightManager">
- <settings default="">
- <module2copyright />
- </settings>
-</component>
View
5 .idea/encodings.xml
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
- <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
-</project>
-
View
37 .idea/inspectionProfiles/Project_Default.xml
@@ -1,37 +0,0 @@
-<component name="InspectionProjectProfileManager">
- <profile version="1.0" is_locked="false">
- <option name="myName" value="Project Default" />
- <option name="myLocal" value="false" />
- <inspection_tool class="JavaDoc" enabled="false" level="WARNING" enabled_by_default="false">
- <option name="TOP_LEVEL_CLASS_OPTIONS">
- <value>
- <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
- <option name="REQUIRED_TAGS" value="" />
- </value>
- </option>
- <option name="INNER_CLASS_OPTIONS">
- <value>
- <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
- <option name="REQUIRED_TAGS" value="" />
- </value>
- </option>
- <option name="METHOD_OPTIONS">
- <value>
- <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
- <option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
- </value>
- </option>
- <option name="FIELD_OPTIONS">
- <value>
- <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
- <option name="REQUIRED_TAGS" value="" />
- </value>
- </option>
- <option name="IGNORE_DEPRECATED" value="false" />
- <option name="IGNORE_JAVADOC_PERIOD" value="true" />
- <option name="IGNORE_DUPLICATED_THROWS" value="false" />
- <option name="IGNORE_POINT_TO_ITSELF" value="false" />
- <option name="myAdditionalJavadocTags" value="" />
- </inspection_tool>
- </profile>
-</component>
View
7 .idea/inspectionProfiles/profiles_settings.xml
@@ -1,7 +0,0 @@
-<component name="InspectionProjectProfileManager">
- <settings>
- <option name="PROJECT_PROFILE" value="Project Default" />
- <option name="USE_PROJECT_PROFILE" value="true" />
- <version value="1.0" />
- </settings>
-</component>
View
15 .idea/libraries/JARs.xml
@@ -1,15 +0,0 @@
-<component name="libraryTable">
- <library name="JARs">
- <CLASSES>
- <root url="file://$PROJECT_DIR$/lib" />
- <root url="jar://$PROJECT_DIR$/build/retrofit-gson-2.1.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES>
- <root url="jar://$PROJECT_DIR$/lib/junit-4.8.1-sources.jar!/" />
- <root url="jar://$PROJECT_DIR$/lib/android-test-2.2.1-sources.jar!/" />
- <root url="jar://$PROJECT_DIR$/build/retrofit-gson-2.1-sources.jar!/" />
- </SOURCES>
- <jarDirectory url="file://$PROJECT_DIR$/lib" recursive="false" />
- </library>
-</component>
View
36 .idea/misc.xml
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
- <component name="EntryPointsManager">
- <entry_points version="2.0" />
- <list size="1">
- <item index="0" class="java.lang.String" itemvalue="com.google.inject.Inject" />
- </list>
- </component>
- <component name="JavadocGenerationManager">
- <option name="OUTPUT_DIRECTORY" />
- <option name="OPTION_SCOPE" value="protected" />
- <option name="OPTION_HIERARCHY" value="true" />
- <option name="OPTION_NAVIGATOR" value="true" />
- <option name="OPTION_INDEX" value="true" />
- <option name="OPTION_SEPARATE_INDEX" value="true" />
- <option name="OPTION_DOCUMENT_TAG_USE" value="false" />
- <option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" />
- <option name="OPTION_DOCUMENT_TAG_VERSION" value="false" />
- <option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" />
- <option name="OPTION_DEPRECATED_LIST" value="true" />
- <option name="OTHER_OPTIONS" value="" />
- <option name="HEAP_SIZE" />
- <option name="LOCALE" />
- <option name="OPEN_IN_BROWSER" value="true" />
- </component>
- <component name="ProjectResources">
- <default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
- </component>
- <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
- <output url="file://$PROJECT_DIR$/out" />
- </component>
- <component name="SvnBranchConfigurationManager">
- <option name="mySupportsUserInfoFilter" value="true" />
- </component>
-</project>
-
View
13 .idea/modules.xml
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
- <component name="ProjectModuleManager">
- <modules>
- <module fileurl="file://$PROJECT_DIR$/modules/android/android.iml" filepath="$PROJECT_DIR$/modules/android/android.iml" />
- <module fileurl="file://$PROJECT_DIR$/modules/core/core.iml" filepath="$PROJECT_DIR$/modules/core/core.iml" />
- <module fileurl="file://$PROJECT_DIR$/modules/http/http.iml" filepath="$PROJECT_DIR$/modules/http/http.iml" />
- <module fileurl="file://$PROJECT_DIR$/modules/io/io.iml" filepath="$PROJECT_DIR$/modules/io/io.iml" />
- <module fileurl="file://$PROJECT_DIR$/modules/android/test_app/test_app.iml" filepath="$PROJECT_DIR$/modules/android/test_app/test_app.iml" />
- </modules>
- </component>
-</project>
-
View
5 .idea/scopes/scope_settings.xml
@@ -1,5 +0,0 @@
-<component name="DependencyValidationManager">
- <state>
- <option name="SKIP_IMPORT_STATEMENTS" value="false" />
- </state>
-</component>
View
125 .idea/uiDesigner.xml
@@ -1,125 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
- <component name="Palette2">
- <group name="Swing">
- <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">
- <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
- </item>
- <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">
- <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
- </item>
- <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
- </item>
- <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
- <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
- </item>
- <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
- <initial-values>
- <property name="text" value="Button" />
- </initial-values>
- </item>
- <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
- <initial-values>
- <property name="text" value="RadioButton" />
- </initial-values>
- </item>
- <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
- <initial-values>
- <property name="text" value="CheckBox" />
- </initial-values>
- </item>
- <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
- <initial-values>
- <property name="text" value="Label" />
- </initial-values>
- </item>
- <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
- <preferred-size width="150" height="-1" />
- </default-constraints>
- </item>
- <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
- <preferred-size width="150" height="-1" />
- </default-constraints>
- </item>
- <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
- <preferred-size width="150" height="-1" />
- </default-constraints>
- </item>
- <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
- <preferred-size width="150" height="50" />
- </default-constraints>
- </item>
- <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
- <preferred-size width="150" height="50" />
- </default-constraints>
- </item>
- <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
- <preferred-size width="150" height="50" />
- </default-constraints>
- </item>
- <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
- </item>
- <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
- <preferred-size width="150" height="50" />
- </default-constraints>
- </item>
- <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
- <preferred-size width="150" height="50" />
- </default-constraints>
- </item>
- <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
- <preferred-size width="150" height="50" />
- </default-constraints>
- </item>
- <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
- <preferred-size width="200" height="200" />
- </default-constraints>
- </item>
- <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
- <preferred-size width="200" height="200" />
- </default-constraints>
- </item>
- <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
- </item>
- <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
- </item>
- <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
- </item>
- <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
- </item>
- <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
- <preferred-size width="-1" height="20" />
- </default-constraints>
- </item>
- <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
- </item>
- <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
- </item>
- </group>
- </component>
-</project>
-
View
7 .idea/vcs.xml
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
- <component name="VcsDirectoryMappings">
- <mapping directory="" vcs="Git" />
- </component>
-</project>
-
View
202 LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
View
53 README.markdown
@@ -1,53 +0,0 @@
-# Retrofit
-
-Reusable Java and Android code from Square, Inc.
-
-Modules:
-
-+ IO: Utility classes for doing low-level java I/O.
-+ Http: Abstracts away the messy logic of making network calls (depends on IO).
-+ Core: Some interfaces and utilities used by the other retrofit modules.
-+ Android: Contains two Android-specific utility classes: ShakeDetector (for detecting device
-shakes) and QueueFile (for storing a queue on the android file-system).
-
-Note that IntelliJ will complain about compilation errors until you run `ant` (to download all the
-dependencies). This command also generates the .jar files that you'll want to include in your
-application.
-
-
-## Http Usage
-
-Create an interface for your API. You can create as many of these interfaces as you like. For
-each interface you create, calling `RestAdapter.service(MyInterface.class)` will create an
-instance of that API handler, which you can then store and use throughout your application. An
-example interface:
-
- public interface DummyService {
- // Produces a url like "foo/bar?id=idValue".
- @GET("foo/bar")
- void normalGet(@Named("id") String id, Callback<SimpleResponse> callback);
-
- // Produces a url like "foo/idValue/bar?category=categoryValue".
- @GET("foo/{id}/bar")
- void getWithPathParam(@Named("id") String id, @Named("category") String category, Callback<SimpleResponse> callback);
-
- // Produces a url like "foo/bar/idValue" and body like "id=idValue&body=bodyValue".
- @POST("foo/bar/{id}")
- void normalPost(@Named("id") String id, @Named("body") String body, Callback<SimpleResponse> callback);
-
- // Produces a url like "foo/bar/idValue" and body generated by MyJsonObj.
- @POST("foo/bar/{id}")
- void singleEntityPost(@SingleEntity MyJsonObj card, @Named("id") String id, Callback<SimpleResponse> callback);
- }
-
-Note that each method _must_ have a Callback object at the end of the parameter list. This is how
-your application will handle the results of your network calls: errors and successful responses are
-both handled by the Callback interface.
-
-If you want to use the @SingleEntity method of specifying request body (see singleEntityPost above),
-your MyJsonObject will need to implement TypedBytes. For convenience, you can extend
-\GsonRequestEntity if you're just trying to send a JSON string in the request body.
-
-Also worth noting: for POST/PUT requests using default form encoding for the request entity (see
-normalPost), any path parameters are also included in the request body. This is different from the
-behavior of GET/DELETE, where path parameters are excluded from the query string.
View
67 README.md
@@ -0,0 +1,67 @@
+Retrofit
+========
+
+Reusable Java and Android code from Square, Inc.
+
+Modules:
+
+ * IO - Utility classes for doing low-level java I/O.
+ * HTTP - Abstracts away the messy logic of making network calls (depends on IO).
+ * Core - Some interfaces and utilities used by the other retrofit modules.
+ * Android - Contains two Android-specific utility classes: `ShakeDetector` (for detecting device
+ shakes) and `QueueFile` (for storing a queue on the android file-system).
+
+
+Http Usage
+----------
+
+Create an interface for your API. You can create as many of these interfaces as you like. For
+each interface you create, calling `RestAdapter.service(MyInterface.class)` will create an
+instance of that API handler, which you can then store and use throughout your application. An
+example interface:
+
+ public interface DummyService {
+ // Produces a url like "foo/bar?id=idValue".
+ @GET("foo/bar")
+ void normalGet(@Named("id") String id, Callback<SimpleResponse> callback);
+
+ // Produces a url like "foo/idValue/bar?category=categoryValue".
+ @GET("foo/{id}/bar")
+ void getWithPathParam(@Named("id") String id, @Named("category") String category, Callback<SimpleResponse> callback);
+
+ // Produces a url like "foo/bar/idValue" and body like "id=idValue&body=bodyValue".
+ @POST("foo/bar/{id}")
+ void normalPost(@Named("id") String id, @Named("body") String body, Callback<SimpleResponse> callback);
+
+ // Produces a url like "foo/bar/idValue" and body generated by MyJsonObj.
+ @POST("foo/bar/{id}")
+ void singleEntityPost(@SingleEntity MyJsonObj card, @Named("id") String id, Callback<SimpleResponse> callback);
+ }
+
+Note that each method _must_ have a `Callback` object at the end of the parameter list. This is how
+your application will handle the results of your network calls: errors and successful responses are
+both handled by the `Callback` interface.
+
+If you want to use the `@SingleEntity` method of specifying request body (see `singleEntityPost` above),
+your `MyJsonObject` will need to implement `TypedBytes`. For convenience, you can extend
+`GsonRequestEntity` if you're just trying to send a JSON string in the request body.
+
+Also worth noting: for POST/PUT requests using default form encoding for the request entity (see
+normalPost), any path parameters are also included in the request body. This is different from the
+behavior of GET/DELETE, where path parameters are excluded from the query string.
+
+
+
+Compilation
+-----------
+
+Retrofit is built using Maven and there is a very minimal amount of setup required for compilation.
+
+Two environment variables are required which point to your Android SDK and native Android SDK. A common
+place to put these is in a `.bash_profile` file in your home directory.
+
+ export ANDROID_HOME=~/dev/android-sdk
+ export ANDROID_NDK_HOME=~/dev/android-ndk
+
+With these two environment variables loaded you can compile the modules and sample application by running
+`mvn clean verify`. Each module's built artifact will be in its respective `target/` folder.
View
2  modules/android/jni/Android.mk → android-native/jni/Android.mk
@@ -2,7 +2,7 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
-LOCAL_MODULE := retrofit
+LOCAL_MODULE := retrofit-android-native
LOCAL_SRC_FILES := retrofit.c
include $(BUILD_SHARED_LIBRARY)
View
0  modules/android/jni/retrofit.c → android-native/jni/retrofit.c
File renamed without changes
View
28 android-native/pom.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>com.squareup</groupId>
+ <artifactId>retrofit</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>com.squareup</groupId>
+ <artifactId>retrofit-android-native</artifactId>
+ <packaging>so</packaging>
+ <name>Retrofit Android (Native)</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.jayway.maven.plugins.android.generation2</groupId>
+ <artifactId>android-maven-plugin</artifactId>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
View
32 android/pom.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>com.squareup</groupId>
+ <artifactId>retrofit</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>com.squareup</groupId>
+ <artifactId>retrofit-android</artifactId>
+ <packaging>jar</packaging>
+ <name>Retrofit Android</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.android</groupId>
+ <artifactId>android</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
View
0  ...d/src/retrofit/android/ShakeDetector.java → .../java/retrofit/android/ShakeDetector.java
File renamed without changes
View
2  ...es/android/src/retrofit/io/QueueFile.java → .../src/main/java/retrofit/io/QueueFile.java
@@ -478,7 +478,7 @@ public synchronized int size() {
/**
* Removes the eldest element.
*
- * @throw NoSuchElementException if the queue is empty
+ * @throws NoSuchElementException if the queue is empty
*/
public synchronized void remove() throws IOException {
if (isEmpty()) throw new NoSuchElementException();
View
15 ...s/retrofit/android/ShakeDetectorTest.java → ...a/retrofit/android/ShakeDetectorTest.java
@@ -1,18 +1,25 @@
// Copyright 2010 Square, Inc.
package retrofit.android;
-import junit.framework.TestCase;
import java.util.List;
-/** @author Eric Burke (eric@squareup.com) */
-public class ShakeDetectorTest extends TestCase {
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * @author Eric Burke (eric@squareup.com)
+ */
+public class ShakeDetectorTest {
public void testInitialShaking() {
ShakeDetector.SampleQueue q = new ShakeDetector.SampleQueue();
assertFalse("shaking", q.isShaking());
}
- /** Tests LG Ally sample rate. */
+ /**
+ * Tests LG Ally sample rate.
+ */
public void testShakingSampleCount3() {
ShakeDetector.SampleQueue q = new ShakeDetector.SampleQueue();
View
23 .../src-tests/retrofit/io/QueueFileTest.java → .../test/java/retrofit/io/QueueFileTest.java
@@ -1,17 +1,20 @@
// Copyright 2010 Square, Inc.
package retrofit.io;
+import org.junit.After;
+import org.junit.Before;
+
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.RandomAccessFile;
-import java.util.Arrays;
import java.util.LinkedList;
import java.util.Queue;
import java.util.logging.Logger;
-import junit.framework.ComparisonFailure;
-import junit.framework.TestCase;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
/**
* Tests for QueueFile.
@@ -19,7 +22,7 @@
* @author Bob Lee (bob@squareup.com)
*/
@SuppressWarnings({"ResultOfMethodCallIgnored"})
-public class QueueFileTest extends TestCase {
+public class QueueFileTest {
private static final Logger logger =
Logger.getLogger(QueueFileTest.class.getName());
@@ -41,12 +44,12 @@
private File file;
- @Override protected void setUp() throws Exception {
+ @Before protected void setUp() throws Exception {
file = File.createTempFile("test.queue", null);
file.delete();
}
- @Override protected void tearDown() throws Exception {
+ @After protected void tearDown() throws Exception {
file.delete();
}
@@ -283,14 +286,6 @@ public void testForEach() throws IOException {
assertEquals(2, iteration[0]);
}
- /** Compares two byte[]s for equality. */
- private static void assertEquals(byte[] expected, byte[] actual) {
- if (!Arrays.equals(expected, actual)) {
- throw new ComparisonFailure(null, Arrays.toString(expected),
- Arrays.toString(actual));
- }
- }
-
/**
* Exercise a bug where wrapped elements were getting corrupted when the
* QueueFile was forced to expand in size and a portion of the final Element
View
88 build-macros.xml
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright 2010 Square, Inc. -->
-
-<!--
- - Ant macro definitions.
- -->
-<project name="Macros" basedir="." default="help">
-
- <target name="help">
- <echo>Import this build file into the main build.xml.</echo>
- </target>
-
- <!--
- - Compiles a module.
- -->
- <macrodef name="compile.module">
- <attribute name="module"
- description="The directory name under 'modules'."/>
- <element name="compile.main.classpath" optional="true"/>
- <element name="compile.tests.classpath" optional="true"/>
-
- <sequential>
- <mkdir dir="${build.dir}/@{module}/main"/>
-
- <!-- Compile src/* and place classes in build/[module]/main. -->
- <javac srcdir="modules/@{module}/src"
- destdir="${build.dir}/@{module}/main"
- fork="true"
- debug="true"
- includeantruntime="false">
- <classpath>
- <fileset dir="${lib.dir}" includes="*.jar"/>
- <compile.main.classpath/>
- </classpath>
- </javac>
-
- <!-- Compile src-tests/* and place classes in build/[module]/tests. -->
- <mkdir dir="${build.dir}/@{module}/tests"/>
- <javac srcdir="modules/@{module}/src-tests"
- destdir="${build.dir}/@{module}/tests"
- fork="true"
- debug="true"
- includeantruntime="false">
- <classpath>
- <fileset dir="${lib.dir}" includes="*.jar"/>
- <pathelement location="${build.dir}/@{module}/main"/>
- <compile.tests.classpath/>
- </classpath>
- </javac>
- </sequential>
- </macrodef>
-
-
- <!--
- - Builds a module's JAR file.
- -->
- <macrodef name="jar.module">
- <attribute name="module"
- description="The directory name under 'modules'."/>
- <element name="compile.main.classpath" optional="true"/>
- <element name="compile.tests.classpath" optional="true"/>
-
- <sequential>
- <!-- Create the JAR files. -->
- <jar jarfile="${build.dir}/retrofit-@{module}-${retrofit.revision}.jar">
- <manifest>
- <attribute name="Build-Time" value="${build.time}"/>
- <attribute name="Copyright"
- value="${build.year}, Square, Inc."/>
- <attribute name="Commit-Hash" value="${commit.hash}"/>
- </manifest>
- <fileset dir="${build.dir}/@{module}/main"/>
- </jar>
-
- <jar jarfile="${build.dir}/retrofit-@{module}-${retrofit.revision}-src.jar">
- <manifest>
- <attribute name="Build-Time" value="${build.time}"/>
- <attribute name="Copyright"
- value="${build.year}, Square, Inc."/>
- <attribute name="Commit-Hash" value="${commit.hash}"/>
- </manifest>
- <fileset dir="modules/@{module}/src"/>
- </jar>
- </sequential>
- </macrodef>
-
-</project>
-
View
215 build.xml
@@ -1,215 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright 2010 Square, Inc. -->
-
-<!--
- - Builds the Retrofit project, relying on Apache Ivy to download external
- - dependencies.
- -
- - Retrofit is divided into modules, all of which are built from this single
- - Ant buildfile. The directory structure is as follows:
- -
- - [project root]
- - modules
- - [module]
- - src
- - src-tests
- -->
-<project
- xmlns:ivy="antlib:org.apache.ivy.ant"
- name="Retrofit" basedir="." default="dist">
-
- <!--
- - The Retrofit version number, becomes part of the JAR file names.
- -->
- <property file="revision.properties"/>
-
- <!-- Import boilerplate Ivy build steps. -->
- <import file="ivy-build.xml"/>
-
- <property name="build.dir" location="build"/>
- <property name="lib.dir" location="lib"/>
-
- <property name="testreports.dir" location="${build.dir}/testreports"/>
-
- <target name="prepare" depends="init-ivy">
- <tstamp>
- <!-- ISO 8601 format: 2010-06-02T15:25:45Z -->
- <format property="build.time" timezone="GMT"
- pattern="yyyy-MM-dd'T'HH:mm:ss'Z'"/>
- <format property="build.year" timezone="GMT"
- pattern="yyyy"/>
- </tstamp>
-
- <!--
- - Assigns the git commit hash to the 'commit.hash' property, sending
- - errors to the Ant log.
- -->
- <exec executable="git"
- outputproperty="commit.hash"
- failifexecutionfails="false"
- logerror="true">
- <arg value="log"/>
- <arg value="-n1"/>
- <arg value="--pretty=format:%H"/>
- </exec>
-
- <!-- Downloads dependencies and places JARs under lib. -->
- <ivy:retrieve/>
- </target>
-
- <target name="clean">
- <delete dir="${build.dir}"/>
- </target>
-
- <target name="clean-libs" depends="clean"
- description="Removes the 'lib' directory.">
- <delete dir="${lib.dir}"/>
- </target>
-
- <import file="build-macros.xml"/>
-
- <target name="repackage-gson" depends="prepare">
- <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask">
- <classpath>
- <fileset dir="lib" includes="jarjar*.jar"/>
- </classpath>
- </taskdef>
- <jarjar jarfile="${build.dir}/retrofit-gson-2.1.jar">
- <zipfileset src="lib/gson-2.1.jar"/>
- <rule pattern="com.google.gson.**" result="retrofit.internal.gson.@1"/>
- </jarjar>
- <jarjar jarfile="${build.dir}/retrofit-gson-2.1-sources.jar">
- <zipfileset src="lib/gson-2.1-sources.jar"/>
- <rule pattern="com.google.gson.**" result="retrofit.internal.gson.@1"/>
- </jarjar>
- </target>
-
- <target name="compile" depends="repackage-gson">
- <!-- Build these in this particular order. -->
- <compile.module module="core"/>
-
- <compile.module module="io">
- <compile.main.classpath>
- <pathelement location="${build.dir}/core/main"/>
- </compile.main.classpath>
- </compile.module>
-
- <compile.module module="http">
- <compile.main.classpath>
- <pathelement location="${build.dir}/core/main"/>
- <pathelement location="${build.dir}/io/main"/>
- <pathelement location="${build.dir}/retrofit-gson-2.1.jar"/>
- </compile.main.classpath>
- <compile.tests.classpath>
- <pathelement location="${build.dir}/core/main"/>
- <pathelement location="${build.dir}/io/main"/>
- <pathelement location="${build.dir}/retrofit-gson-2.1.jar"/>
- </compile.tests.classpath>
- </compile.module>
-
- <compile.module module="android"/>
- </target>
-
- <target name="jar" depends="compile">
- <jar.module module="android"/>
- <jar.module module="core"/>
- <jar.module module="http"/>
- <jar.module module="io"/>
- </target>
-
- <target name="require.tests"
- description="Sets a property so test failures abort the build.">
- <property name="require.tests" value="true"/>
- </target>
-
- <target name="test" depends="compile" description="Runs tests.">
- <mkdir dir="${testreports.dir}"/>
-
- <!--
- - If this property isn't already set, assume broken tests should not
- - abort the build.
- -->
- <property name="require.tests" value="false"/>
-
- <junit printsummary="true" haltonfailure="${require.tests}">
- <classpath>
- <pathelement location="${build.dir}/android/main"/>
- <pathelement location="${build.dir}/android/tests"/>
- <pathelement location="${build.dir}/core/main"/>
- <pathelement location="${build.dir}/core/tests"/>
- <pathelement location="${build.dir}/http/main"/>
- <pathelement location="${build.dir}/http/tests"/>
- <pathelement location="${build.dir}/io/main"/>
- <pathelement location="${build.dir}/io/tests"/>
- <fileset dir="${build.dir}" includes="retrofit-gson*.jar"/>
- <fileset dir="${lib.dir}" includes="*.jar"/>
- </classpath>
-
- <formatter type="xml"/>
-
- <batchtest todir="${testreports.dir}">
- <fileset dir="modules/android/src-tests">
- <include name="**/*Test.java"/>
- </fileset>
- <fileset dir="modules/core/src-tests">
- <include name="**/*Test.java"/>
- </fileset>
- <fileset dir="modules/io/src-tests">
- <include name="**/*Test.java"/>
- </fileset>
- <fileset dir="modules/http/src-tests">
- <include name="**/*Test.java"/>
- </fileset>
- </batchtest>
- </junit>
-
- <junitreport todir="${testreports.dir}">
- <fileset dir="${testreports.dir}" includes="TEST-*.xml"/>
-
- <report todir="${testreports.dir}"/>
- </junitreport>
-
- <echo
- message="${line.separator}Test report written to:${line.separator}${testreports.dir}/index.html"/>
- </target>
-
- <!--
- - Publishes to the Ivy repository using the resolver named
- - 'retrofit-resolver'.
- -->
- <target name="publish" depends="dist">
- <ivy:publish
- pubrevision="${retrofit.revision}"
- resolver="retrofit-resolver"
- forcedeliver="true"
- update="true"
- overwrite="true"
- publishivy="true">
- <!--
- - This pattern selects which files will be published. The artifact
- - pattern in ivy-settings.xml controls how the names matched here are
- - published in the Ivy repository.
- -->
- <artifacts pattern="${build.dir}/[artifact]-[revision](-[classifier]).[ext]"/>
- </ivy:publish>
- </target>
-
- <target name="dist" depends="clean,require.tests,test,jar"
- description="Compiles, ensures tests pass, and creates all deliverables.">
- <zip zipfile="${build.dir}/retrofit-${retrofit.revision}.zip">
- <zipfileset prefix="retrofit" dir=".">
- <exclude name="build/**"/>
- <exclude name="out/**"/>
- <exclude name="lib/**"/>
- <exclude name="**/.git/**"/>
- <exclude name=".gitignore"/>
- <exclude name=".idea/**"/>
- <exclude name="*.iml"/>
- </zipfileset>
- <zipfileset prefix="retrofit/bin" dir="${build.dir}">
- <include name="retrofit-*.jar"/>
- </zipfileset>
- </zip>
- </target>
-</project>
-
View
26 core/pom.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>com.squareup</groupId>
+ <artifactId>retrofit</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>com.squareup</groupId>
+ <artifactId>retrofit-core</artifactId>
+ <packaging>jar</packaging>
+ <name>Retrofit Core</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
View
0  modules/core/src/retrofit/core/Callback.java → ...src/main/java/retrofit/core/Callback.java
File renamed without changes
View
0  ...es/core/src/retrofit/core/MainThread.java → ...c/main/java/retrofit/core/MainThread.java
File renamed without changes
View
0  ...e/src/retrofit/core/ProgressListener.java → .../java/retrofit/core/ProgressListener.java
File renamed without changes
View
0  ...e/src/retrofit/core/internal/Objects.java → .../java/retrofit/core/internal/Objects.java
File renamed without changes
View
9 ...s/retrofit/core/internal/ObjectsTest.java → ...a/retrofit/core/internal/ObjectsTest.java
@@ -1,10 +1,13 @@
// Copyright 2010 Square, Inc.
package retrofit.core.internal;
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
-/** @author Eric Burke (eric@squareup.com) */
-public class ObjectsTest extends TestCase {
+/**
+ * @author Eric Burke (eric@squareup.com)
+ */
+public class ObjectsTest {
public void testNonNull() {
Objects.nonNull(10, "whatever");
try {
View
81 http/pom.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>com.squareup</groupId>
+ <artifactId>retrofit</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>com.squareup</groupId>
+ <artifactId>retrofit-http</artifactId>
+ <packaging>jar</packaging>
+ <name>Retrofit HTTP</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.squareup</groupId>
+ <artifactId>retrofit-io</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.inject</groupId>
+ <artifactId>guice</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpmime</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymock</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>jarjar-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>jarjar</goal>
+ </goals>
+ <configuration>
+ <includes>
+ <include>com.google.code.gson:gson</include>
+ </includes>
+ <rules>
+ <rule>
+ <pattern>com.google.gson.**</pattern>
+ <result>retrofit.internal.gson.@1</result>
+ </rule>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
View
4 ...etrofit/http/CallbackResponseHandler.java → ...etrofit/http/CallbackResponseHandler.java
@@ -5,13 +5,13 @@
import java.util.logging.Level;
import java.util.logging.Logger;
+import com.google.gson.Gson;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.StatusLine;
import org.apache.http.client.ResponseHandler;
import org.apache.http.entity.BufferedHttpEntity;
import retrofit.core.Callback;
-import retrofit.internal.gson.Gson;
/**
* Support for response handlers that invoke {@link Callback}.
@@ -30,7 +30,7 @@
private static final int GATEWAY_TIMEOUT = 504;
private final Callback<T> callback;
-
+
private final Gson gson;
protected CallbackResponseHandler(Gson gson, Callback<T> callback) {
View
0  modules/http/src/retrofit/http/DELETE.java → http/src/main/java/retrofit/http/DELETE.java
File renamed without changes
View
2  modules/http/src/retrofit/http/Fetcher.java → .../src/main/java/retrofit/http/Fetcher.java
@@ -1,6 +1,7 @@
// Copyright 2010 Square, Inc.
package retrofit.http;
+import com.google.gson.Gson;
import com.google.inject.Inject;
import com.google.inject.Provider;
import java.io.IOException;
@@ -14,7 +15,6 @@
import retrofit.core.Callback;
import retrofit.core.MainThread;
import retrofit.core.ProgressListener;
-import retrofit.internal.gson.Gson;
import retrofit.io.ByteSink;
import static retrofit.core.internal.Objects.nonNull;
View
0  modules/http/src/retrofit/http/GET.java → http/src/main/java/retrofit/http/GET.java
File renamed without changes
View
4 ...rc/retrofit/http/GsonResponseHandler.java → ...va/retrofit/http/GsonResponseHandler.java
@@ -1,9 +1,9 @@
package retrofit.http;
+import com.google.gson.Gson;
+import com.google.gson.JsonParseException;
import org.apache.http.HttpEntity;
import retrofit.core.Callback;
-import retrofit.internal.gson.Gson;
-import retrofit.internal.gson.JsonParseException;
import java.io.IOException;
import java.io.InputStreamReader;
View
0  modules/http/src/retrofit/http/Headers.java → .../src/main/java/retrofit/http/Headers.java
File renamed without changes
View
0  ...s/http/src/retrofit/http/HttpClients.java → .../main/java/retrofit/http/HttpClients.java
File renamed without changes
View
0  ...es/http/src/retrofit/http/HttpMethod.java → ...c/main/java/retrofit/http/HttpMethod.java
File renamed without changes
View
0  ...ttp/src/retrofit/http/HttpMethodType.java → ...in/java/retrofit/http/HttpMethodType.java
File renamed without changes
View
0  .../http/src/retrofit/http/HttpProfiler.java → ...main/java/retrofit/http/HttpProfiler.java
File renamed without changes
View
2  ...src/retrofit/http/HttpRequestBuilder.java → ...ava/retrofit/http/HttpRequestBuilder.java
@@ -1,10 +1,10 @@
package retrofit.http;
+import com.google.gson.Gson;
import com.google.inject.name.Named;
import org.apache.http.NameValuePair;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.message.BasicNameValuePair;
-import retrofit.internal.gson.Gson;
import retrofit.io.MimeType;
import retrofit.io.TypedBytes;
View
0  modules/http/src/retrofit/http/POST.java → http/src/main/java/retrofit/http/POST.java
File renamed without changes
View
0  modules/http/src/retrofit/http/PUT.java → http/src/main/java/retrofit/http/PUT.java
File renamed without changes
View
0  ...es/http/src/retrofit/http/QueryParam.java → ...c/main/java/retrofit/http/QueryParam.java
File renamed without changes
View
0  ...s/http/src/retrofit/http/QueryParams.java → .../main/java/retrofit/http/QueryParams.java
File renamed without changes
View
0  ...s/http/src/retrofit/http/RequestLine.java → .../main/java/retrofit/http/RequestLine.java
File renamed without changes
View
2  ...s/http/src/retrofit/http/RestAdapter.java → .../main/java/retrofit/http/RestAdapter.java
@@ -1,5 +1,6 @@
package retrofit.http;
+import com.google.gson.Gson;
import com.google.inject.Binder;
import com.google.inject.Inject;
import com.google.inject.Module;
@@ -21,7 +22,6 @@
import org.apache.http.client.methods.HttpUriRequest;
import retrofit.core.Callback;
import retrofit.core.MainThread;
-import retrofit.internal.gson.Gson;
/**
* Converts Java method calls to Rest calls.
View
0  modules/http/src/retrofit/http/Server.java → http/src/main/java/retrofit/http/Server.java
File renamed without changes
View
0  ...tp/src/retrofit/http/ServerException.java → ...n/java/retrofit/http/ServerException.java
File renamed without changes
View
0  .../http/src/retrofit/http/SingleEntity.java → ...main/java/retrofit/http/SingleEntity.java
File renamed without changes
View
0  ...ttp/src/retrofit/http/TypedBytesBody.java → ...in/java/retrofit/http/TypedBytesBody.java
File renamed without changes
View
0  ...p/src/retrofit/http/TypedBytesEntity.java → .../java/retrofit/http/TypedBytesEntity.java
File renamed without changes
View
0  ...es/http/src/retrofit/http/UiCallback.java → ...c/main/java/retrofit/http/UiCallback.java
File renamed without changes
View
0  ...-tests/retrofit/http/DummyHttpClient.java → ...t/java/retrofit/http/DummyHttpClient.java
File renamed without changes
View
2  .../src-tests/retrofit/http/FetcherTest.java → .../test/java/retrofit/http/FetcherTest.java
@@ -1,6 +1,7 @@
// Copyright 2010 Square, Inc.
package retrofit.http;
+import com.google.gson.Gson;
import com.google.inject.Provider;
import junit.framework.Assert;
import junit.framework.TestCase;
@@ -13,7 +14,6 @@
import retrofit.core.Callback;
import retrofit.core.MainThread;
import retrofit.core.ProgressListener;
-import retrofit.internal.gson.Gson;
import retrofit.io.ByteSink;
import java.io.ByteArrayOutputStream;
View
2  ...retrofit/http/HttpRequestBuilderTest.java → ...retrofit/http/HttpRequestBuilderTest.java
@@ -1,6 +1,7 @@
// Copyright 2011 Square, Inc.
package retrofit.http;
+import com.google.gson.Gson;
import com.google.inject.name.Named;
import java.io.ByteArrayOutputStream;
import java.lang.reflect.Method;
@@ -13,7 +14,6 @@
import org.apache.http.client.methods.HttpPut;
import org.apache.http.client.methods.HttpUriRequest;
import retrofit.core.Callback;
-import retrofit.internal.gson.Gson;
/** @author Eric Denman (edenman@squareup.com) */
public class HttpRequestBuilderTest extends TestCase {
View
2  ...-tests/retrofit/http/RestAdapterTest.java → ...t/java/retrofit/http/RestAdapterTest.java
@@ -1,5 +1,6 @@
package retrofit.http;
+import com.google.gson.Gson;
import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
@@ -24,7 +25,6 @@
import org.junit.Before;
import retrofit.core.Callback;
import retrofit.core.MainThread;
-import retrofit.internal.gson.Gson;
import static org.easymock.EasyMock.capture;
import static org.easymock.EasyMock.createMock;
View
49 io/pom.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>com.squareup</groupId>
+ <artifactId>retrofit</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>com.squareup</groupId>
+ <artifactId>retrofit-io</artifactId>
+ <packaging>jar</packaging>
+ <name>Retrofit I/O</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.squareup</groupId>
+ <artifactId>retrofit-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.squareup</groupId>
+ <artifactId>retrofit-android-native</artifactId>
+ <version>${project.version}</version>
+ <type>so</type>
+ <classifier>armeabi</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.jayway.maven.plugins.android.generation2</groupId>
+ <artifactId>android-maven-plugin</artifactId>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
View
0  ...o/src/retrofit/io/AbstractTypedBytes.java → .../java/retrofit/io/AbstractTypedBytes.java
File renamed without changes
View
0  modules/io/src/retrofit/io/ByteSink.java → io/src/main/java/retrofit/io/ByteSink.java
File renamed without changes
View
0  modules/io/src/retrofit/io/ByteSinks.java → io/src/main/java/retrofit/io/ByteSinks.java
File renamed without changes
View
0  modules/io/src/retrofit/io/Files.java → io/src/main/java/retrofit/io/Files.java
File renamed without changes
View
0  modules/io/src/retrofit/io/MimeType.java → io/src/main/java/retrofit/io/MimeType.java
File renamed without changes
View
0  ...es/io/src/retrofit/io/TypedByteArray.java → ...main/java/retrofit/io/TypedByteArray.java
File renamed without changes
View
0  modules/io/src/retrofit/io/TypedBytes.java → io/src/main/java/retrofit/io/TypedBytes.java
File renamed without changes
View
0  modules/io/src/retrofit/io/TypedFile.java → io/src/main/java/retrofit/io/TypedFile.java
File renamed without changes
View
9 ...s/io/src-tests/retrofit/io/FilesTest.java → io/src/test/java/retrofit/io/FilesTest.java
@@ -1,17 +1,18 @@
// Copyright 2011 Square, Inc.
package retrofit.io;
-import junit.framework.TestCase;
-
-import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
/**
* @author Paul Hawke (psh@squareup.com)
*/
-public class FilesTest extends TestCase {
+public class FilesTest {
public void testDelete() throws Exception {
File tmpFile = File.createTempFile("prefix", ".tmp");
PrintWriter pw = new PrintWriter(new FileWriter(tmpFile));
View
9 ...tests/retrofit/io/TypedByteArrayTest.java → .../java/retrofit/io/TypedByteArrayTest.java
@@ -1,10 +1,13 @@
// Copyright 2010 Square, Inc.
package retrofit.io;
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
-/** @author Eric Burke (eric@squareup.com) */
-public class TypedByteArrayTest extends TestCase {
+/**
+ * @author Eric Burke (eric@squareup.com)
+ */
+public class TypedByteArrayTest {
public void testEquals() {
TypedByteArray a1 = new TypedByteArray(new byte[]{10, 20}, MimeType.GIF);
TypedByteArray a2 = new TypedByteArray(new byte[]{10, 20}, MimeType.GIF);
View
11 .../src-tests/retrofit/io/TypedFileTest.java → .../test/java/retrofit/io/TypedFileTest.java
@@ -1,14 +1,17 @@
// Copyright 2010 Square, Inc.
package retrofit.io;
-import junit.framework.TestCase;
-
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
-/** @author Eric Burke (eric@squareup.com) */
-public class TypedFileTest extends TestCase {
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+
+/**
+ * @author Eric Burke (eric@squareup.com)
+ */
+public class TypedFileTest {
public void testNotEquals() {
TypedFile a = new TypedFile(new File("a.png"), MimeType.PNG);
TypedFile b = new TypedFile(new File("b.png"), MimeType.PNG);
View
48 ivy-build.xml
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright 2010 Square, Inc. -->
-
-<!--
- - Ivy boilerplate build steps, helps keep the main buildfile clean.
- -->
-<project xmlns:ivy="antlib:org.apache.ivy.ant"
- name="ivy-build" basedir="." default="init-ivy">
-
- <property name="ivy.install.version" value="2.2.0"/>
- <condition property="ivy.home" value="${env.IVY_HOME}">
- <isset property="env.IVY_HOME"/>
- </condition>
- <property name="ivy.home" value="${user.home}/.ant"/>
- <property name="ivy.jar.dir" value="${ivy.home}/lib"/>
- <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/>
-
- <!--
- - Gets Ivy from the public Maven repo so we don't need a custom Ant
- - installation.
- -->
- <target name="download-ivy" unless="offline">
- <mkdir dir="${ivy.jar.dir}"/>
- <get
- src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
- dest="${ivy.jar.file}" usetimestamp="true"/>
- </target>
-
- <target name="init-ivy" depends="download-ivy">
- <!--
- - Try to load ivy here from ivy home, in case the user has not already
- - dropped it into ant's lib dir (note that the latter copy will always
- - take precedence). We will not fail as long as local lib dir exists (it
- - may be empty) and ivy is in at least one of ant's lib dir or the local
- - lib dir.
- -->
- <path id="ivy.lib.path">
- <fileset dir="${ivy.jar.dir}" includes="*.jar"/>
- </path>
-
- <taskdef resource="org/apache/ivy/ant/antlib.xml"
- uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
-
- <ivy:configure file="ivy-settings.xml"/>
- </target>
-
-</project>
-
View
24 ivy-settings.xml
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2010 Square, Inc. -->
-
-<!--
- - Configures the Ivy resolver. The Ant build file references this using the
- - <ivy:configure file="ivy-settings.xml"/> tag.
- -
- - @author Eric Burke (eric@squareup.com)
- -->
-<ivysettings>
- <settings defaultResolver="retrofit-resolver"/>
- <resolvers>
- <chain name="retrofit-resolver">
- <filesystem name="libraries">
- <!--
- - This pattern controls how artifacts are named when published to
- - the repository.
- -->
- <artifact pattern="${ivy.default.ivy.user.dir}/repository/[artifact]-[revision](-[classifier]).[ext]"/>
- </filesystem>
- <ibiblio name="ibiblio" m2compatible="true"/>
- </chain>
- </resolvers>
-</ivysettings>
View
36 ivy.xml
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2010 Square, Inc. -->
-
-<!--
- - Ivy module file, describing dependencies on other projects.
- -
- - @author Eric Burke (eric@squareup.com)
- -->
-<ivy-module
- version="2.0"
- xmlns:e="http://ant.apache.org/ivy/extra"
- >
- <info organisation="com.squareup" module="retrofit"/>
-
- <configurations>
- <conf name="android" description="Classes with Android dependencies."/>
- </configurations>
-
- <publications>
- <artifact conf="android" name="retrofit-android" ext="jar"/>
- <artifact conf="android" name="retrofit-android" ext="jar" e:classifier="src"/>
- </publications>
-
- <!-- Note: find these at http://mvnrepository.com/ -->
- <dependencies>
- <dependency org="com.google.android" name="android-test" rev="2.2.1"/>
- <dependency org="com.google.code.gson" name="gson" rev="2.1"/>
- <dependency org="com.googlecode.jarjar" name="jarjar" rev="1.1"/>
- <dependency org="com.google.code.guice" name="guice" rev="1.0"/>
- <dependency org="org.apache.httpcomponents" name="httpmime" rev="4.1-alpha1"/>
- <dependency org="junit" name="junit" rev="4.8.1"/>
- <dependency org="org.apache.httpcomponents" name="httpclient" rev="4.1-alpha1"/>
- <dependency org="org.easymock" name="easymock" rev="2.5.2"/>
- </dependencies>
-
-</ivy-module>
View
2  modules/android/.gitignore
@@ -1,2 +0,0 @@
-android-ndk
-obj
View
13 modules/android/README.jni
@@ -1,13 +0,0 @@
-The native portions of Retofit's Android module live in ./jni.
-
-Building:
-
- ./build-jni.sh
-
-Installation:
-
- Copy ./libs to your Android project root.
-
-Testing:
-
- Run test_app on a device or emulator.
View
14 modules/android/android.iml
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module type="JAVA_MODULE" version="4">
- <component name="NewModuleRootManager" inherit-compiler-output="true">
- <exclude-output />
- <content url="file://$MODULE_DIR$">
- <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
- <sourceFolder url="file://$MODULE_DIR$/src-tests" isTestSource="true" />
- </content>
- <orderEntry type="inheritedJdk" />
- <orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="library" name="JARs" level="project" />
- </component>
-</module>
-
View
13 modules/android/build-jni.sh
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-if [ ! -d android-ndk ]
-then
- echo Downloading Android NDK...
- curl http://dl.google.com/android/ndk/android-ndk-r5b-darwin-x86.tar.bz2 > /tmp/android-ndk.tgz
- echo Extracting Android NDK...
- tar zxf /tmp/android-ndk.tgz -C /tmp
- mv /tmp/android-ndk-r5b ./android-ndk
-fi
-
-./android-ndk/ndk-build
-
View
BIN  modules/android/libs/armeabi/libretrofit.so
Binary file not shown
View
3  modules/android/test_app/.gitignore
@@ -1,3 +0,0 @@
-libs
-gen
-bin
View
17 modules/android/test_app/build.properties
@@ -1,17 +0,0 @@
-# This file is used to override default values used by the Ant build system.
-#
-# This file must be checked in Version Control Systems, as it is
-# integral to the build system of your project.
-
-# This file is only used by the Ant script.
-
-# You can use this to override default values such as
-# 'source.dir' for the location of your java source folder and
-# 'out.dir' for the location of your output folder.
-
-# You can also use it define how the release builds are signed by declaring
-# the following properties:
-# 'key.store' for the location of your keystore and
-# 'key.alias' for the name of the key to use.
-# The password will be asked during the build when you use the 'release' target.
-
View
94 modules/android/test_app/build.xml
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="test_app" default="help">
-
- <target name="-pre-build">
- <mkdir dir="libs"/>
-
- <!-- Copy native library. -->
- <copy todir="libs/armeabi">
- <fileset dir="../libs/armeabi"/>
- </copy>
-
- <!-- Copy Retrofit's Java library. -->
- <copy todir="libs">
- <fileset dir="../../../build" includes="retrofit-io*.jar"
- excludes="*src*"/>
- </copy>
- </target>
-
-<!-- The local.properties file is created and updated by the 'android'
- tool.
- It contains the path to the SDK. It should *NOT* be checked into
- Version Control Systems. -->
- <property file="local.properties" />
-
- <!-- The build.properties file can be created by you and is never touched
- by the 'android' tool. This is the place to change some of the
- default property values used by the Ant rules.
- Here are some properties you may want to change/update:
-
- source.dir
- The name of the source directory. Default is 'src'.
- out.dir
- The name of the output directory. Default is 'bin'.
-
- Properties related to the SDK location or the project target should
- be updated using the 'android' tool with the 'update' action.
-
- This file is an integral part of the build system for your
- application and should be checked into Version Control Systems.
-
- -->
- <property file="build.properties" />
-
- <!-- The default.properties file is created and updated by the 'android'
- tool, as well as ADT.
- This file is an integral part of the build system for your
- application and should be checked into Version Control Systems. -->
- <property file="default.properties" />
-
-
- <!-- Required pre-setup import -->
- &