diff --git a/.gitmodules b/.gitmodules
index 2be15080..bddcb0cc 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,6 +1,3 @@
-[submodule "GmsApi"]
-	path = GmsApi
+[submodule "play-services-api"]
+	path = play-services-api
 	url = https://github.com/microg/android_external_GmsApi.git
-[submodule "SafeParcel"]
-	path = SafeParcel
-	url = https://github.com/microg/android_external_SafeParcel.git
diff --git a/GmsApi b/GmsApi
deleted file mode 160000
index 3243e7d3..00000000
--- a/GmsApi
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 3243e7d3ecf2f7ff92279b61c4a7e7831356f5c7
diff --git a/SafeParcel b/SafeParcel
deleted file mode 160000
index a650ca5b..00000000
--- a/SafeParcel
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit a650ca5beac2a374460d820935b40f9539e692db
diff --git a/SafeParcel b/SafeParcel
new file mode 120000
index 00000000..18f7aa75
--- /dev/null
+++ b/SafeParcel
@@ -0,0 +1 @@
+play-services-api/SafeParcel/
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index 15771b0c..252327cb 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,30 +1,15 @@
-buildscript {
-    repositories {
-        mavenCentral()
-    }
-    dependencies {
-        classpath 'com.android.tools.build:gradle:1.0.1'
-    }
-}
-
-apply plugin: 'com.android.library'
-
-dependencies {
-    compile 'com.android.support:support-v4:21.0.3'
-    compile project(':GmsApi')
-}
-
-android {
-    compileSdkVersion 21
-    buildToolsVersion "21.1.2"
-    lintOptions.abortOnError false
-
-    sourceSets {
-        main {
-            manifest.srcFile 'AndroidManifest.xml'
-            java.srcDirs = ['src']
-            aidl.srcDirs = ['src']
-            res.srcDirs = ['res']
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+subprojects {
+    buildscript {
+        repositories {
+            mavenCentral()
+        }
+        dependencies {
+            classpath 'com.android.tools.build:gradle:1.0.1'
+            classpath 'com.github.dcendents:android-maven-plugin:1.2'
         }
     }
-}
+
+    group = 'org.microg.gms'
+    version = '1.0-SNAPSHOT'
+}
\ No newline at end of file
diff --git a/play-services-api b/play-services-api
new file mode 160000
index 00000000..d2ec5f52
--- /dev/null
+++ b/play-services-api
@@ -0,0 +1 @@
+Subproject commit d2ec5f52fa6c1aed0640e65130b20e3ffce5f8b0
diff --git a/play-services-base/build.gradle b/play-services-base/build.gradle
new file mode 100644
index 00000000..8a308f2f
--- /dev/null
+++ b/play-services-base/build.gradle
@@ -0,0 +1,12 @@
+apply plugin: 'com.android.library'
+apply plugin: 'com.github.dcendents.android-maven'
+
+dependencies {
+    compile 'com.android.support:support-v4:22.0.0'
+    compile project(':play-services-api')
+}
+
+android {
+    compileSdkVersion 22
+    buildToolsVersion "21.1.2"
+}
diff --git a/play-services-base/src/main/AndroidManifest.xml b/play-services-base/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..9fa720e3
--- /dev/null
+++ b/play-services-base/src/main/AndroidManifest.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.google.android.gms">
+
+    <uses-sdk android:minSdkVersion="9" />
+</manifest>
diff --git a/src/com/google/android/gms/common/ConnectionResult.java b/play-services-base/src/main/java/com/google/android/gms/common/ConnectionResult.java
similarity index 100%
rename from src/com/google/android/gms/common/ConnectionResult.java
rename to play-services-base/src/main/java/com/google/android/gms/common/ConnectionResult.java
diff --git a/src/com/google/android/gms/common/GooglePlayServicesClient.java b/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesClient.java
similarity index 100%
rename from src/com/google/android/gms/common/GooglePlayServicesClient.java
rename to play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesClient.java
diff --git a/src/com/google/android/gms/common/GooglePlayServicesUtil.java b/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesUtil.java
similarity index 100%
rename from src/com/google/android/gms/common/GooglePlayServicesUtil.java
rename to play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesUtil.java
diff --git a/src/com/google/android/gms/common/api/Api.java b/play-services-base/src/main/java/com/google/android/gms/common/api/Api.java
similarity index 100%
rename from src/com/google/android/gms/common/api/Api.java
rename to play-services-base/src/main/java/com/google/android/gms/common/api/Api.java
diff --git a/src/com/google/android/gms/common/api/GoogleApiClient.java b/play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java
similarity index 100%
rename from src/com/google/android/gms/common/api/GoogleApiClient.java
rename to play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java
diff --git a/src/com/google/android/gms/common/api/PendingResult.java b/play-services-base/src/main/java/com/google/android/gms/common/api/PendingResult.java
similarity index 100%
rename from src/com/google/android/gms/common/api/PendingResult.java
rename to play-services-base/src/main/java/com/google/android/gms/common/api/PendingResult.java
diff --git a/src/com/google/android/gms/common/api/Releasable.java b/play-services-base/src/main/java/com/google/android/gms/common/api/Releasable.java
similarity index 100%
rename from src/com/google/android/gms/common/api/Releasable.java
rename to play-services-base/src/main/java/com/google/android/gms/common/api/Releasable.java
diff --git a/src/com/google/android/gms/common/api/ResultCallback.java b/play-services-base/src/main/java/com/google/android/gms/common/api/ResultCallback.java
similarity index 100%
rename from src/com/google/android/gms/common/api/ResultCallback.java
rename to play-services-base/src/main/java/com/google/android/gms/common/api/ResultCallback.java
diff --git a/src/org/microg/gms/common/ForwardConnectionCallbacks.java b/play-services-base/src/main/java/org/microg/gms/common/ForwardConnectionCallbacks.java
similarity index 100%
rename from src/org/microg/gms/common/ForwardConnectionCallbacks.java
rename to play-services-base/src/main/java/org/microg/gms/common/ForwardConnectionCallbacks.java
diff --git a/src/org/microg/gms/common/ForwardConnectionFailedListener.java b/play-services-base/src/main/java/org/microg/gms/common/ForwardConnectionFailedListener.java
similarity index 100%
rename from src/org/microg/gms/common/ForwardConnectionFailedListener.java
rename to play-services-base/src/main/java/org/microg/gms/common/ForwardConnectionFailedListener.java
diff --git a/src/org/microg/gms/common/GmsClient.java b/play-services-base/src/main/java/org/microg/gms/common/GmsClient.java
similarity index 100%
rename from src/org/microg/gms/common/GmsClient.java
rename to play-services-base/src/main/java/org/microg/gms/common/GmsClient.java
diff --git a/src/org/microg/gms/common/GmsConnector.java b/play-services-base/src/main/java/org/microg/gms/common/GmsConnector.java
similarity index 100%
rename from src/org/microg/gms/common/GmsConnector.java
rename to play-services-base/src/main/java/org/microg/gms/common/GmsConnector.java
diff --git a/src/org/microg/gms/common/MultiConnectionKeeper.java b/play-services-base/src/main/java/org/microg/gms/common/MultiConnectionKeeper.java
similarity index 100%
rename from src/org/microg/gms/common/MultiConnectionKeeper.java
rename to play-services-base/src/main/java/org/microg/gms/common/MultiConnectionKeeper.java
diff --git a/src/org/microg/gms/common/api/AbstractPendingResult.java b/play-services-base/src/main/java/org/microg/gms/common/api/AbstractPendingResult.java
similarity index 100%
rename from src/org/microg/gms/common/api/AbstractPendingResult.java
rename to play-services-base/src/main/java/org/microg/gms/common/api/AbstractPendingResult.java
diff --git a/src/org/microg/gms/common/api/AbstractPlayServicesClient.java b/play-services-base/src/main/java/org/microg/gms/common/api/AbstractPlayServicesClient.java
similarity index 100%
rename from src/org/microg/gms/common/api/AbstractPlayServicesClient.java
rename to play-services-base/src/main/java/org/microg/gms/common/api/AbstractPlayServicesClient.java
diff --git a/src/org/microg/gms/common/api/ApiBuilder.java b/play-services-base/src/main/java/org/microg/gms/common/api/ApiBuilder.java
similarity index 100%
rename from src/org/microg/gms/common/api/ApiBuilder.java
rename to play-services-base/src/main/java/org/microg/gms/common/api/ApiBuilder.java
diff --git a/src/org/microg/gms/common/api/ApiConnection.java b/play-services-base/src/main/java/org/microg/gms/common/api/ApiConnection.java
similarity index 100%
rename from src/org/microg/gms/common/api/ApiConnection.java
rename to play-services-base/src/main/java/org/microg/gms/common/api/ApiConnection.java
diff --git a/src/org/microg/gms/common/api/GoogleApiClientImpl.java b/play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java
similarity index 100%
rename from src/org/microg/gms/common/api/GoogleApiClientImpl.java
rename to play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java
diff --git a/src/org/microg/gms/common/api/ResultCallbackHandler.java b/play-services-base/src/main/java/org/microg/gms/common/api/ResultCallbackHandler.java
similarity index 100%
rename from src/org/microg/gms/common/api/ResultCallbackHandler.java
rename to play-services-base/src/main/java/org/microg/gms/common/api/ResultCallbackHandler.java
diff --git a/play-services-location/build.gradle b/play-services-location/build.gradle
new file mode 100644
index 00000000..f79b92c5
--- /dev/null
+++ b/play-services-location/build.gradle
@@ -0,0 +1,11 @@
+apply plugin: 'com.android.library'
+apply plugin: 'com.github.dcendents.android-maven'
+
+dependencies {
+    compile project(':play-services-base')
+}
+
+android {
+    compileSdkVersion 22
+    buildToolsVersion "22.0.0"
+}
\ No newline at end of file
diff --git a/AndroidManifest.xml b/play-services-location/src/main/AndroidManifest.xml
similarity index 100%
rename from AndroidManifest.xml
rename to play-services-location/src/main/AndroidManifest.xml
diff --git a/src/com/google/android/gms/location/FusedLocationProviderApi.java b/play-services-location/src/main/java/com/google/android/gms/location/FusedLocationProviderApi.java
similarity index 100%
rename from src/com/google/android/gms/location/FusedLocationProviderApi.java
rename to play-services-location/src/main/java/com/google/android/gms/location/FusedLocationProviderApi.java
diff --git a/src/com/google/android/gms/location/GeofencingApi.java b/play-services-location/src/main/java/com/google/android/gms/location/GeofencingApi.java
similarity index 100%
rename from src/com/google/android/gms/location/GeofencingApi.java
rename to play-services-location/src/main/java/com/google/android/gms/location/GeofencingApi.java
diff --git a/src/com/google/android/gms/location/LocationClient.java b/play-services-location/src/main/java/com/google/android/gms/location/LocationClient.java
similarity index 100%
rename from src/com/google/android/gms/location/LocationClient.java
rename to play-services-location/src/main/java/com/google/android/gms/location/LocationClient.java
diff --git a/src/com/google/android/gms/location/LocationListener.java b/play-services-location/src/main/java/com/google/android/gms/location/LocationListener.java
similarity index 100%
rename from src/com/google/android/gms/location/LocationListener.java
rename to play-services-location/src/main/java/com/google/android/gms/location/LocationListener.java
diff --git a/src/com/google/android/gms/location/LocationServices.java b/play-services-location/src/main/java/com/google/android/gms/location/LocationServices.java
similarity index 100%
rename from src/com/google/android/gms/location/LocationServices.java
rename to play-services-location/src/main/java/com/google/android/gms/location/LocationServices.java
diff --git a/src/org/microg/gms/location/FusedLocationProviderApiImpl.java b/play-services-location/src/main/java/org/microg/gms/location/FusedLocationProviderApiImpl.java
similarity index 100%
rename from src/org/microg/gms/location/FusedLocationProviderApiImpl.java
rename to play-services-location/src/main/java/org/microg/gms/location/FusedLocationProviderApiImpl.java
diff --git a/src/org/microg/gms/location/GeofencingApiImpl.java b/play-services-location/src/main/java/org/microg/gms/location/GeofencingApiImpl.java
similarity index 100%
rename from src/org/microg/gms/location/GeofencingApiImpl.java
rename to play-services-location/src/main/java/org/microg/gms/location/GeofencingApiImpl.java
diff --git a/src/org/microg/gms/location/GoogleLocationManagerClient.java b/play-services-location/src/main/java/org/microg/gms/location/GoogleLocationManagerClient.java
similarity index 100%
rename from src/org/microg/gms/location/GoogleLocationManagerClient.java
rename to play-services-location/src/main/java/org/microg/gms/location/GoogleLocationManagerClient.java
diff --git a/src/org/microg/gms/location/LocationClientImpl.java b/play-services-location/src/main/java/org/microg/gms/location/LocationClientImpl.java
similarity index 100%
rename from src/org/microg/gms/location/LocationClientImpl.java
rename to play-services-location/src/main/java/org/microg/gms/location/LocationClientImpl.java
diff --git a/src/org/microg/gms/location/LocationServicesApiBuilder.java b/play-services-location/src/main/java/org/microg/gms/location/LocationServicesApiBuilder.java
similarity index 100%
rename from src/org/microg/gms/location/LocationServicesApiBuilder.java
rename to play-services-location/src/main/java/org/microg/gms/location/LocationServicesApiBuilder.java
diff --git a/src/org/microg/gms/location/NativeLocationClientImpl.java b/play-services-location/src/main/java/org/microg/gms/location/NativeLocationClientImpl.java
similarity index 100%
rename from src/org/microg/gms/location/NativeLocationClientImpl.java
rename to play-services-location/src/main/java/org/microg/gms/location/NativeLocationClientImpl.java
diff --git a/play-services-wearable/build.gradle b/play-services-wearable/build.gradle
new file mode 100644
index 00000000..5e701f76
--- /dev/null
+++ b/play-services-wearable/build.gradle
@@ -0,0 +1,11 @@
+apply plugin: 'com.android.library'
+apply plugin: 'com.github.dcendents.android-maven'
+
+dependencies {
+    compile project(':play-services-base')
+}
+
+android {
+    compileSdkVersion 21
+    buildToolsVersion "21.1.2"
+}
diff --git a/play-services-wearable/src/main/AndroidManifest.xml b/play-services-wearable/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..9fa720e3
--- /dev/null
+++ b/play-services-wearable/src/main/AndroidManifest.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.google.android.gms">
+
+    <uses-sdk android:minSdkVersion="9" />
+</manifest>
diff --git a/src/com/google/android/gms/wearable/DataApi.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataApi.java
similarity index 100%
rename from src/com/google/android/gms/wearable/DataApi.java
rename to play-services-wearable/src/main/java/com/google/android/gms/wearable/DataApi.java
diff --git a/src/com/google/android/gms/wearable/MessageApi.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageApi.java
similarity index 100%
rename from src/com/google/android/gms/wearable/MessageApi.java
rename to play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageApi.java
diff --git a/src/com/google/android/gms/wearable/NodeApi.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/NodeApi.java
similarity index 100%
rename from src/com/google/android/gms/wearable/NodeApi.java
rename to play-services-wearable/src/main/java/com/google/android/gms/wearable/NodeApi.java
diff --git a/src/com/google/android/gms/wearable/Wearable.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/Wearable.java
similarity index 100%
rename from src/com/google/android/gms/wearable/Wearable.java
rename to play-services-wearable/src/main/java/com/google/android/gms/wearable/Wearable.java
diff --git a/src/org/microg/gms/wearable/DataApiImpl.java b/play-services-wearable/src/main/java/org/microg/gms/wearable/DataApiImpl.java
similarity index 100%
rename from src/org/microg/gms/wearable/DataApiImpl.java
rename to play-services-wearable/src/main/java/org/microg/gms/wearable/DataApiImpl.java
diff --git a/src/org/microg/gms/wearable/MessageApiImpl.java b/play-services-wearable/src/main/java/org/microg/gms/wearable/MessageApiImpl.java
similarity index 100%
rename from src/org/microg/gms/wearable/MessageApiImpl.java
rename to play-services-wearable/src/main/java/org/microg/gms/wearable/MessageApiImpl.java
diff --git a/src/org/microg/gms/wearable/NodeApiImpl.java b/play-services-wearable/src/main/java/org/microg/gms/wearable/NodeApiImpl.java
similarity index 100%
rename from src/org/microg/gms/wearable/NodeApiImpl.java
rename to play-services-wearable/src/main/java/org/microg/gms/wearable/NodeApiImpl.java
diff --git a/src/org/microg/gms/wearable/WearableApiBuilder.java b/play-services-wearable/src/main/java/org/microg/gms/wearable/WearableApiBuilder.java
similarity index 100%
rename from src/org/microg/gms/wearable/WearableApiBuilder.java
rename to play-services-wearable/src/main/java/org/microg/gms/wearable/WearableApiBuilder.java
diff --git a/play-services/build.gradle b/play-services/build.gradle
new file mode 100644
index 00000000..4d357641
--- /dev/null
+++ b/play-services/build.gradle
@@ -0,0 +1,14 @@
+apply plugin: 'com.android.library'
+apply plugin: 'com.github.dcendents.android-maven'
+
+dependencies {
+    compile 'com.android.support:support-v4:21.0.3'
+    compile project(':play-services-base')
+    compile project(':play-services-location')
+    compile project(':play-services-wearable')
+}
+
+android {
+    compileSdkVersion 21
+    buildToolsVersion "22.0.0"
+}
diff --git a/res/values/version.xml b/play-services/res/values/version.xml
similarity index 100%
rename from res/values/version.xml
rename to play-services/res/values/version.xml
diff --git a/play-services/src/main/AndroidManifest.xml b/play-services/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..9fa720e3
--- /dev/null
+++ b/play-services/src/main/AndroidManifest.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.google.android.gms">
+
+    <uses-sdk android:minSdkVersion="9" />
+</manifest>
diff --git a/settings.gradle b/settings.gradle
index 87e5535f..c87b1990 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1 +1,8 @@
-include ':GmsApi', ':SafeParcel'
+include ':SafeParcel'
+include ':play-services-api'
+
+include ':play-services-base'
+include ':play-services-location'
+include ':play-services-wearable'
+
+include ':play-services'