Skip to content

Commit

Permalink
Merge branch 'manager_db_upgrade_dev' into 'master'
Browse files Browse the repository at this point in the history
manager_db_upgrade_dev



See merge request !76
  • Loading branch information
shifujun committed Apr 30, 2019
2 parents b2e48de + 146feec commit 45126bd
Show file tree
Hide file tree
Showing 68 changed files with 2,145 additions and 136 deletions.
1 change: 1 addition & 0 deletions buildScripts/gradle/maven.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ task testSdk() {
dependsOn gradle.includedBuild('core').task(':transform-kit:test')
dependsOn gradle.includedBuild('core').task(':transform:test')
dependsOn gradle.includedBuild('core').task(':gradle-plugin:test')
dependsOn gradle.includedBuild('core').task(':manager:connectedDebugAndroidTest')
dependsOn ':projects:demo:host-apk:connectedDebugAndroidTest'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void loadPlugin(String partKey) {
throw new NullPointerException("partKey == " + partKey);
}

LoadParameters loadParameters = new LoadParameters(partKey, 0, null);
LoadParameters loadParameters = new LoadParameters(null, partKey, null, null);

Parcel parcel = Parcel.obtain();
loadParameters.writeToParcel(parcel, 0);
Expand Down
2 changes: 2 additions & 0 deletions projects/demo/host-apk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-remote:3.2.0-alpha02'
implementation 'androidx.test.espresso:espresso-idling-resource:3.2.0-alpha02'
androidTestImplementation "androidx.test:runner:1.1.2-alpha02"

implementation project(':projects:demo:host_interface')
}

def createCopyTask(projectName, buildType, name, apkName, inputFile, taskName) {
Expand Down
7 changes: 6 additions & 1 deletion projects/demo/host-apk/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,9 @@

-keep class com.tencent.shadow.dynamic.host.**{*;}
-keep class com.tencent.shadow.core.common.**{*;}
-keep class com.tencent.shadow.runtime.container.**{*;}
-keep class com.tencent.shadow.runtime.container.**{*;}

#--start 下面是为了keep 插件访问宿主的白名单类--
-keep class com.tencent.shadow.demo.interfaces.**{*;}
-keep class com.tencent.shadow.demo.other.**{*;}
#--end--
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.tencent.shadow.demo.host;

import android.content.Intent;

import androidx.test.core.app.ApplicationProvider;

public class ActivityContextSubDirTest extends SubDirContextThemeWrapperTest {
@Override
Intent getLaunchIntent() {
Intent pluginIntent = new Intent();
String packageName = ApplicationProvider.getApplicationContext().getPackageName();
pluginIntent.setClassName(
packageName,
"com.tencent.shadow.demo.usecases.context.ActivityContextSubDirTestActivity"
);
return pluginIntent;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.tencent.shadow.demo.host;

import android.content.Intent;

import androidx.test.core.app.ApplicationProvider;

public class ApplicationContextSubDirTest extends SubDirContextThemeWrapperTest {
@Override
Intent getLaunchIntent() {
Intent pluginIntent = new Intent();
String packageName = ApplicationProvider.getApplicationContext().getPackageName();
pluginIntent.setClassName(
packageName,
"com.tencent.shadow.demo.usecases.context.ApplicationContextSubDirTestActivity"
);
return pluginIntent;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.tencent.shadow.demo.host;

import android.content.Intent;

import androidx.test.core.app.ApplicationProvider;
import androidx.test.espresso.Espresso;
import androidx.test.espresso.action.ViewActions;
import androidx.test.espresso.matcher.ViewMatchers;

import com.tencent.shadow.demo.interfaces.HostTestInterface;
import com.tencent.shadow.demo.other.HostOtherInterface;

import org.hamcrest.Matchers;
import org.junit.Test;

public class HostInterfaceTest extends BaseTest {

@Override
Intent getLaunchIntent() {
Intent pluginIntent = new Intent();
String packageName = ApplicationProvider.getApplicationContext().getPackageName();
pluginIntent.setClassName(
packageName,
"com.tencent.shadow.demo.usecases.interfaces.TestHostInterfaceActivity"
);
return pluginIntent;
}

@Test
public void testHostInterfaceTest() {
Espresso.onView(ViewMatchers.withTagValue(Matchers.<Object>is("button"))).perform(ViewActions.click());

matchTextWithViewTag("text", HostTestInterface.getText());

Espresso.onView(ViewMatchers.withTagValue(Matchers.<Object>is("button1"))).perform(ViewActions.click());

matchTextWithViewTag("text", "ClassNotFound");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.tencent.shadow.demo.host;

import android.content.Intent;

import androidx.test.core.app.ApplicationProvider;

public class ServiceContextSubDirTest extends SubDirContextThemeWrapperTest {
@Override
Intent getLaunchIntent() {
Intent pluginIntent = new Intent();
String packageName = ApplicationProvider.getApplicationContext().getPackageName();
pluginIntent.setClassName(
packageName,
"com.tencent.shadow.demo.usecases.context.ServiceContextSubDirTestActivity"
);
return pluginIntent;
}
}
Loading

0 comments on commit 45126bd

Please sign in to comment.