Skip to content

Commit

Permalink
Reuse common AssetExtract.java
Browse files Browse the repository at this point in the history
Also removes unused `mActivity` member.
Note we changed the constructor input parameter to accept a `Context`
object which is a parent class of the previous `Activity` one.
Changes were tested on both kivy and service_only bootstraps.
Also removes the `get_common_dir()` as it's no longer used since #2092
  • Loading branch information
AndreMiras committed May 9, 2020
1 parent f96356b commit 4fbcefd
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 126 deletions.
3 changes: 0 additions & 3 deletions pythonforandroid/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@ def get_build_dir(self):
def get_dist_dir(self, name):
return join(self.ctx.dist_dir, name)

def get_common_dir(self):
return os.path.abspath(join(self.bootstrap_dir, "..", 'common'))

@property
def name(self):
modname = self.__class__.__module__
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import java.io.*;

import android.app.Activity;
import android.content.Context;
import android.util.Log;

import java.io.BufferedInputStream;
Expand All @@ -24,11 +24,9 @@
public class AssetExtract {

private AssetManager mAssetManager = null;
private Activity mActivity = null;

public AssetExtract(Activity act) {
mActivity = act;
mAssetManager = act.getAssets();
public AssetExtract(Context context) {
mAssetManager = context.getAssets();
}

public boolean extractTar(String asset, String target) {
Expand Down

This file was deleted.

3 changes: 0 additions & 3 deletions tests/test_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ def test_build_dist_dirs(self):
bs.get_build_dir().endswith("build/bootstrap_builds/sdl2")
)
self.assertTrue(bs.get_dist_dir("test_prj").endswith("dists/test_prj"))
self.assertTrue(
bs.get_common_dir().endswith("pythonforandroid/bootstraps/common")
)

def test__cmp_bootstraps_by_priority(self):
# Test service_only has higher priority than sdl2:
Expand Down

0 comments on commit 4fbcefd

Please sign in to comment.