• Stars
    star
    100
  • Rank 340,703 (Top 7 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created almost 10 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Google Cloud Endpoint (GCE) to Retrofit

gce2retrofit

Generates Retrofit interfaces and related models from Google Cloud Endpoint (GCE) discovery files.

Usage

Configuration files

Put the configuration files for each GCE server in a directory under src/main/gce2retrofit.

discovery.json (required)

The discovery doc from GCE. e.g. https://2-dot-test-pont.appspot.com/_ah/api/discovery/v1/apis/helloworld/v1/rest

methods.csv (optional)

Valid values are sync, async and reactive. If omitted, both synchronous and asynchronous interfaces will be generated.

classmap.tsv (optional)

Map fields with the specified names to the specified types.

room.json (optional)

Map classes/fields with specific room annotations and attributes.

Format:

{
  "class_name" : [
    {
      "annotation1" : "annotation_name1",
      "attributes" : {
        "attribute_name" : "value",
        "attribute_name_2" : "value_2"
      }
    }
  ],
  "class_name.field_name" : [
    {
      "annotation1" : "annotation_name1"
    },
    {
      "annotation2" : "annotation_name2"
    }
  ]
}

See gce2retrofit/src/test/resources/room/room.json for an example.

Code will be generated in build/generated/source/gce2retrofit/

See sample-java/src/main/gce2retrofit/helloworld for an example.

Gradle plugin

Apply the plugin in your build.gradle:

buildscript {
  repositories {
    jcenter()
    maven {
      url 'http://oss.sonatype.org/content/repositories/snapshots/'
    }
  }
  dependencies {
    classpath 'com.sqisland:gce2retrofit:2.0.0-SNAPSHOT'
  }
}

apply plugin: 'com.sqisland.gce2retrofit'

Upgrade guide

Version 2.0.0

Migrate your project to AndroidX

Version 1.6.0

Room.json file has been updated so each type(class/field) takes a list of annotations.

Version 1.1.0

Primitives have been replaced by Objects e.g. Integer instead of int. Please go through your code and make sure that you check for null before using the value of any Boolean, Integer, Float and Double.

Contributing

Please see CONTRIBUTING.md.

More Repositories

1

advanced-textview

Advanced Android TextView
Java
1,188
star
2

espresso-samples

A collection of samples demonstrating different Espresso techniques.
Kotlin
634
star
3

android-test-demo

Android testing with Dagger 2, Espresso 2 and Mockito
Java
619
star
4

android-recyclerview

Android RecyclerView
Java
528
star
5

friendspell

Party icebreaker game based on the Google Nearby API
Java
414
star
6

android-graphics-demo

Android Graphics Demo
Java
369
star
7

animated-vector-drawable

Android AnimatedVectorDrawable examples
Java
324
star
8

sliding-pane-layout

SlidingPaneLayout that is partially visible, with cross fade.
Java
220
star
9

android-swipe-image-viewer

Android Image Viewer that moves to the previous and next images by swiping
Java
142
star
10

android-hello-world

Android Hello World from the ground up
Java
94
star
11

android-gcm

GCM Sample Client and Server
Java
68
star
12

chiuki.github.com

HTML
45
star
13

mockwebserver-demo

MockWebServer demos
Java
34
star
14

android-square-view

Custom view that enforces its width and height to be equal
Java
27
star
15

android-fraction-view

Hands-on Android Custom View Workshop
Java
23
star
16

daggerless-di-testing

Daggerless Dependency Injection for Testing
Java
21
star
17

android-testing-recipes

Java
18
star
18

android-length-picker

Android custom compound control that displays length in feet and inches
Java
15
star
19

android-photo-spiral

Android custom ViewGroup that positions four photos in a spiral
Java
14
star
20

android-protected-provider

Java
14
star
21

ghc12-letter

10
star
22

android-pizza

Android custom view that draws a pizza
Java
9
star
23

iconlabeltext

Java
8
star
24

android-date-view

Android custom view that displays today's date
Java
7
star
25

android-sideways-layout

Android custom ViewGroup that rotates a LinearLayout sideways
Java
6
star
26

android-pendulum-animation

Java
5
star
27

puzzlepal

Dart
4
star
28

espresso-number-picker

Java
4
star
29

transition-shared-finish

Kotlin
3
star
30

techspeak

Technically Speaking
Shell
2
star
31

drop2drink

Appengine code to show SF Drinking Hydrants
Python
2
star
32

intent-implicit

Demonstrate implicit intents
Java
2
star
33

bacon-extension

Chrome extension to replace capitalized words with Bacon on Twitter
JavaScript
1
star
34

intent-dice

Demonstrate explicit intents
Java
1
star