Skip to content

Commit

Permalink
Add web-client dir to android asset source sets
Browse files Browse the repository at this point in the history
  • Loading branch information
nekocode committed Feb 8, 2018
1 parent b9026c3 commit 43988dc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions android-godeye-monitor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ android {
}
}

sourceSets {
main.assets.srcDirs += '../web-client'
}
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public AssetsModule(Context context, String preffix) {

@Override
public byte[] process(String path, Uri uri) throws Throwable {
String fileName = mPreffix + "/" + uri.getPath();
String fileName = mPreffix == null ? uri.getPath() : mPreffix + "/" + uri.getPath();
return loadContent(fileName, mAssets);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static Router get() {

public void init(Context context) {
mRouteModules = new ArrayMap<>();
AssetsModule assetsModule = new AssetsModule(context, "androidgodeye");
AssetsModule assetsModule = new AssetsModule(context, null);
mRouteModules.put("assets", assetsModule);
AppInfoModule appInfoModule = new AppInfoModule();
mRouteModules.put("appinfo", appInfoModule);
Expand Down

0 comments on commit 43988dc

Please sign in to comment.