Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor package structure #368

Merged
merged 4 commits into from
Mar 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jdk:
- oraclejdk8

script:
- ./gradlew clean build connectedCheck -x checkstyleTest --stacktrace
- ./gradlew clean build connectedCheck -x checkstyleTest -x :apollo-integration:compileDebugUnitTestJavaWithJavac -x :apollo-integration:compileReleaseUnitTestJavaWithJavac --stacktrace
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can do -Dapollographql.skipRuntimeDep=true -x apollo-gradle-plugin:test faster than commenting out next time 😀


before_script:
- echo no | android create avd --force -n test -t android-15 --abi armeabi-v7a
Expand Down
6 changes: 3 additions & 3 deletions apollo-api/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
POM_ARTIFACT_ID=api
POM_NAME=Apollo Android API
POM_DESCRIPTION=Apollo Android API classes
POM_ARTIFACT_ID=apollo-api
POM_NAME=Apollo GraphQL API
POM_DESCRIPTION=Apollo GraphQL API classes
POM_PACKAGING=jar
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@
/** TODO **/
public interface ResponseReader {
<T> T read(Field field) throws IOException;

interface ValueHandler {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happened to interface?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not used, legacy (forgot to remove when we refactored response readers)

void handle(int fieldIndex, Object value) throws IOException;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import javax.inject.Inject
class ApolloPlugin implements Plugin<Project> {
private static final String NODE_VERSION = "6.7.0"
public static final String TASK_GROUP = "apollo"
private static final String APOLLO_DEP_GROUP = "com.apollographql.android"
private static final String RUNTIME_DEP_NAME = "runtime"
private static final String APOLLO_DEP_GROUP = "com.apollographql"
private static final String RUNTIME_DEP_NAME = "apollo-runtime"

private Project project
private final FileResolver fileResolver
Expand Down Expand Up @@ -65,7 +65,8 @@ class ApolloPlugin implements Plugin<Project> {
"apollo-runtime version ${apolloRuntimeDep.version} isn't compatible with the apollo-gradle-plugin version ${VersionKt.VERSION}")
}
if (System.getProperty("apollographql.skipRuntimeDep") != "true" && apolloRuntimeDep == null) {
compileDepSet.add(project.dependencies.create("$APOLLO_DEP_GROUP:$RUNTIME_DEP_NAME:$VersionKt.VERSION"))
//TODO https://github.com/apollographql/apollo-android/issues/374
// compileDepSet.add(project.dependencies.create("$APOLLO_DEP_GROUP:$RUNTIME_DEP_NAME:$VersionKt.VERSION"))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,22 @@ class ApolloAndroidPluginSpec extends Specification {
assert (project.extensions.findByType(ApolloExtension.class)) != null
}

def "adds apollo-runtime dependency if not skipped and not found in compile dep list"() {
given:
def project = ProjectBuilder.builder().build()
ApolloPluginTestHelper.setupDefaultAndroidProject(project)

when:
ApolloPluginTestHelper.applyApolloPlugin(project)
project.evaluate()

then:
def apolloRuntime = project.configurations.getByName("compile").dependencies.find {
it.group == "com.apollographql.android" && it.name == "runtime"
}
assert apolloRuntime != null
}
//TODO https://github.com/apollographql/apollo-android/issues/374
// def "adds apollo-runtime dependency if not skipped and not found in compile dep list"() {
// given:
// def project = ProjectBuilder.builder().build()
// ApolloPluginTestHelper.setupDefaultAndroidProject(project)
//
// when:
// ApolloPluginTestHelper.applyApolloPlugin(project)
// project.evaluate()
//
// then:
// def apolloRuntime = project.configurations.getByName("compile").dependencies.find {
// it.group == "com.apollographql.android" && it.name == "runtime"
// }
// assert apolloRuntime != null
// }

def "doesn't add apollo-runtime dependency if skip property is set" () {
given:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package com.apollographql.android.impl;
package com.apollographql.apollo;

import android.support.annotation.NonNull;

import com.apollographql.android.ApolloCall;
import com.apollographql.android.ApolloWatcher;
import com.apollographql.android.api.graphql.Response;
import com.apollographql.android.cache.normalized.CacheControl;
import com.apollographql.android.cache.normalized.CacheKey;
import com.apollographql.android.cache.normalized.CacheKeyResolver;
import com.apollographql.android.cache.normalized.CacheStore;
import com.apollographql.apollo.cache.normalized.CacheControl;
import com.apollographql.apollo.cache.normalized.CacheKey;
import com.apollographql.apollo.cache.normalized.CacheKeyResolver;
import com.apollographql.apollo.cache.normalized.CacheStore;
import com.apollographql.android.impl.normalizer.EpisodeHeroName;
import com.apollographql.android.impl.normalizer.HeroAndFriendsNamesWithIDs;
import com.apollographql.android.impl.normalizer.type.Episode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package com.apollographql.android.impl;
package com.apollographql.apollo;

import com.google.common.base.Strings;

import android.support.annotation.NonNull;

import com.apollographql.android.ApolloCall;
import com.apollographql.android.api.graphql.Response;
import com.apollographql.android.cache.normalized.CacheControl;
import com.apollographql.android.cache.normalized.CacheKey;
import com.apollographql.android.cache.normalized.CacheKeyResolver;
import com.apollographql.apollo.cache.normalized.CacheControl;
import com.apollographql.apollo.cache.normalized.CacheKey;
import com.apollographql.apollo.cache.normalized.CacheKeyResolver;
import com.apollographql.android.impl.normalizer.EpisodeHeroName;
import com.apollographql.android.impl.normalizer.type.Episode;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package com.apollographql.android.impl;
package com.apollographql.apollo;

import com.apollographql.android.CustomTypeAdapter;
import com.apollographql.android.api.graphql.Response;
import com.apollographql.android.cache.http.DiskLruCacheStore;
import com.apollographql.android.cache.http.HttpCache;
import com.apollographql.android.cache.http.HttpCacheControl;
import com.apollographql.android.cache.http.TimeoutEvictionStrategy;
import com.apollographql.apollo.cache.http.DiskLruCacheStore;
import com.apollographql.apollo.internal.cache.http.HttpCache;
import com.apollographql.apollo.cache.http.HttpCacheControl;
import com.apollographql.apollo.cache.http.TimeoutEvictionStrategy;
import com.apollographql.android.impl.httpcache.AllFilms;
import com.apollographql.android.impl.httpcache.AllPlanets;
import com.apollographql.android.impl.httpcache.DroidDetails;
import com.apollographql.android.impl.httpcache.type.CustomType;
import com.apollographql.android.impl.util.HttpException;
import com.apollographql.apollo.internal.interceptor.ApolloServerInterceptor;

import junit.framework.Assert;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.apollographql.android.impl;
package com.apollographql.apollo;

import com.apollographql.android.cache.http.ResponseCacheRecord;
import com.apollographql.android.cache.http.ResponseCacheRecordEditor;
import com.apollographql.android.cache.http.ResponseCacheStore;
import com.apollographql.apollo.cache.http.ResponseCacheRecord;
import com.apollographql.apollo.cache.http.ResponseCacheRecordEditor;
import com.apollographql.apollo.cache.http.ResponseCacheStore;

import java.io.File;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.apollographql.android.impl;
package com.apollographql.apollo;

import com.apollographql.android.cache.normalized.CacheStore;
import com.apollographql.android.cache.normalized.Record;
import com.apollographql.android.cache.normalized.RecordSet;
import com.apollographql.apollo.cache.normalized.CacheStore;
import com.apollographql.apollo.cache.normalized.Record;
import com.apollographql.apollo.cache.normalized.RecordSet;

import java.util.Collection;
import java.util.LinkedHashSet;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package com.apollographql.android.impl;
package com.apollographql.apollo;

import com.google.common.base.Charsets;
import com.google.common.base.Function;
import com.google.common.collect.FluentIterable;

import com.apollographql.android.ApolloCall;
import com.apollographql.android.CustomTypeAdapter;
import com.apollographql.android.api.graphql.Error;
import com.apollographql.android.api.graphql.Response;
import com.apollographql.android.impl.httpcache.AllFilms;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.apollographql.android.impl;
package com.apollographql.apollo;

import com.apollographql.android.cache.http.ResponseCacheRecord;
import com.apollographql.android.cache.http.ResponseCacheRecordEditor;
import com.apollographql.android.cache.http.ResponseCacheStore;
import com.apollographql.apollo.cache.http.ResponseCacheRecord;
import com.apollographql.apollo.cache.http.ResponseCacheRecordEditor;
import com.apollographql.apollo.cache.http.ResponseCacheStore;

import java.io.IOException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.apollographql.android.impl;
package com.apollographql.apollo;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.apollographql.android.impl;
package com.apollographql.apollo;

import java.io.File;
import java.io.FileNotFoundException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.apollographql.android.impl;
package com.apollographql.apollo;

import android.support.annotation.NonNull;

import com.apollographql.android.api.graphql.Response;
import com.apollographql.android.cache.normalized.CacheControl;
import com.apollographql.android.cache.normalized.CacheKey;
import com.apollographql.android.cache.normalized.CacheKeyResolver;
import com.apollographql.apollo.cache.normalized.CacheControl;
import com.apollographql.apollo.cache.normalized.CacheKey;
import com.apollographql.apollo.cache.normalized.CacheKeyResolver;
import com.apollographql.android.impl.normalizer.EpisodeHeroName;
import com.apollographql.android.impl.normalizer.HeroAndFriendsNames;
import com.apollographql.android.impl.normalizer.HeroAndFriendsNamesWithIDForParentOnly;
Expand All @@ -28,7 +28,6 @@
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;

import static com.apollographql.android.impl.Utils.immediateExecutorService;
import static com.google.common.truth.Truth.assertThat;

public class NormalizedCacheTestCase {
Expand All @@ -54,7 +53,7 @@ public class NormalizedCacheTestCase {
return CacheKey.from(id);
}
})
.dispatcher(immediateExecutorService())
.dispatcher(Utils.immediateExecutorService())
.build();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package com.apollographql.android.impl;
package com.apollographql.apollo;

import android.support.annotation.NonNull;

import com.apollographql.android.ApolloCall;
import com.apollographql.android.CustomTypeAdapter;
import com.apollographql.android.api.graphql.Response;
import com.apollographql.android.cache.normalized.CacheKey;
import com.apollographql.android.cache.normalized.CacheKeyResolver;
import com.apollographql.android.cache.normalized.CacheReference;
import com.apollographql.android.cache.normalized.Record;
import com.apollographql.apollo.cache.normalized.CacheKey;
import com.apollographql.apollo.cache.normalized.CacheKeyResolver;
import com.apollographql.apollo.cache.normalized.CacheReference;
import com.apollographql.apollo.cache.normalized.Record;
import com.apollographql.android.impl.normalizer.EpisodeHeroName;
import com.apollographql.android.impl.normalizer.HeroAndFriendsNames;
import com.apollographql.android.impl.normalizer.HeroAndFriendsNamesWithIDForParentOnly;
Expand Down Expand Up @@ -38,7 +36,6 @@
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;

import static com.apollographql.android.impl.Utils.immediateExecutorService;
import static com.apollographql.android.impl.normalizer.type.Episode.EMPIRE;
import static com.apollographql.android.impl.normalizer.type.Episode.JEDI;
import static com.google.common.truth.Truth.assertThat;
Expand Down Expand Up @@ -84,7 +81,7 @@ public class ResponseNormalizationTest {
return CacheKey.from(id);
}
})
.dispatcher(immediateExecutorService())
.dispatcher(Utils.immediateExecutorService())
.build();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package com.apollographql.android.impl;
package com.apollographql.apollo;

import android.support.annotation.NonNull;

import com.apollographql.android.ApolloCall;
import com.apollographql.android.ApolloWatcher;
import com.apollographql.android.cache.normalized.CacheControl;
import com.apollographql.android.cache.normalized.CacheKey;
import com.apollographql.android.cache.normalized.CacheKeyResolver;
import com.apollographql.apollo.cache.normalized.CacheControl;
import com.apollographql.apollo.cache.normalized.CacheKey;
import com.apollographql.apollo.cache.normalized.CacheKeyResolver;
import com.apollographql.android.impl.normalizer.EpisodeHeroName;
import com.apollographql.android.impl.normalizer.HeroAndFriendsNamesWithIDs;
import com.apollographql.android.impl.normalizer.type.Episode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.apollographql.android.impl;
package com.apollographql.apollo;

import com.google.common.io.CharStreams;

Expand Down
6 changes: 3 additions & 3 deletions apollo-runtime/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
POM_ARTIFACT_ID=runtime
POM_NAME=ApolloStack Runtime
POM_DESCRIPTION=Runtime library to support generated code
POM_ARTIFACT_ID=apollo-runtime
POM_NAME=Apollo GraphQL Runtime
POM_DESCRIPTION=Apollo GraphQL runtime library to support generated code
POM_PACKAGING=aar
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package com.apollographql.android.cache.normalized.sql;
package com.apollographql.apollo.cache.normalized.sql;

import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import com.apollographql.android.api.graphql.internal.Optional;
import com.apollographql.android.cache.normalized.FieldsAdapter;
import com.apollographql.android.cache.normalized.Record;
import com.apollographql.apollo.cache.normalized.sql.FieldsAdapter;
import com.apollographql.apollo.cache.normalized.Record;
import com.apollographql.apollo.cache.normalized.sql.ApolloSqlHelper;
import com.apollographql.apollo.cache.normalized.sql.SqlStore;

import org.junit.Before;
import org.junit.Test;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.apollographql.android;
package com.apollographql.apollo;

import com.apollographql.apollo.internal.util.Cancelable;
import com.apollographql.android.api.graphql.Operation;
import com.apollographql.android.api.graphql.Response;
import com.apollographql.android.cache.http.HttpCacheControl;
import com.apollographql.android.cache.normalized.CacheControl;
import com.apollographql.apollo.cache.http.HttpCacheControl;
import com.apollographql.apollo.cache.normalized.CacheControl;

import java.io.IOException;

Expand Down
Loading