Search in sources :

Example 6 with ScopedStateStore

use of com.android.tools.idea.wizard.dynamic.ScopedStateStore in project android by JetBrains.

the class NewModuleWizardDynamic method initState.

/**
   * Populate our state store with some common configuration items, such as the SDK location and the Gradle configuration.
   */
private void initState() {
    ScopedStateStore state = getState();
    Project project = getProject();
    NewProjectWizardDynamic.initState(state, determineGradlePluginVersion(project));
    if (project != null) {
        state.put(WizardConstants.PROJECT_LOCATION_KEY, project.getBasePath());
    }
    // Todo: check if we need an IAPK in the project
    state.put(ALSO_CREATE_IAPK_KEY, false);
}
Also used : Project(com.intellij.openapi.project.Project) ScopedStateStore(com.android.tools.idea.wizard.dynamic.ScopedStateStore)

Example 7 with ScopedStateStore

use of com.android.tools.idea.wizard.dynamic.ScopedStateStore in project android by JetBrains.

the class ConfigureAndroidModuleStepDynamicTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    ApplicationManager.getApplication().runWriteAction(() -> {
        final ModuleManager manager = ModuleManager.getInstance(getProject());
        File moduleRoot = new File(getProject().getBasePath(), "app");
        manager.newModule(moduleRoot.getPath(), ModuleTypeId.JAVA_MODULE);
        moduleRoot = new File(getProject().getBasePath(), "Lib");
        manager.newModule(moduleRoot.getPath(), ModuleTypeId.JAVA_MODULE);
        moduleRoot = new File(getProject().getBasePath(), "lib2");
        manager.newModule(moduleRoot.getPath(), ModuleTypeId.JAVA_MODULE);
    });
    ScopedStateStore wizardState = new ScopedStateStore(ScopedStateStore.Scope.WIZARD, null, null);
    ScopedStateStore pathState = new ScopedStateStore(ScopedStateStore.Scope.PATH, wizardState, null);
    myStep = new ConfigureAndroidModuleStepDynamic(getTestRootDisposable(), FormFactor.MOBILE);
    myStep.myState = new ScopedStateStore(ScopedStateStore.Scope.STEP, pathState, myStep);
}
Also used : ScopedStateStore(com.android.tools.idea.wizard.dynamic.ScopedStateStore) ConfigureAndroidModuleStepDynamic(com.android.tools.idea.npw.deprecated.ConfigureAndroidModuleStepDynamic) ModuleManager(com.intellij.openapi.module.ModuleManager) File(java.io.File)

Aggregations

ScopedStateStore (com.android.tools.idea.wizard.dynamic.ScopedStateStore)7 File (java.io.File)3 Nullable (org.jetbrains.annotations.Nullable)2 RemotePackage (com.android.repository.api.RemotePackage)1 FakePackage (com.android.repository.testframework.FakePackage)1 MockFileOp (com.android.repository.testframework.MockFileOp)1 AvdInfo (com.android.sdklib.internal.avd.AvdInfo)1 AndroidSdkHandler (com.android.sdklib.repository.AndroidSdkHandler)1 DetailsTypes (com.android.sdklib.repository.meta.DetailsTypes)1 RepoFactory (com.android.sdklib.repository.meta.RepoFactory)1 AvdManagerConnection (com.android.tools.idea.avdmanager.AvdManagerConnection)1 FormFactor (com.android.tools.idea.npw.FormFactor)1 ModuleTemplate (com.android.tools.idea.npw.ModuleTemplate)1 ModuleTemplateProvider (com.android.tools.idea.npw.ModuleTemplateProvider)1 NewProjectModelTest (com.android.tools.idea.npw.NewProjectModelTest)1 ConfigureAndroidModuleStepDynamic (com.android.tools.idea.npw.deprecated.ConfigureAndroidModuleStepDynamic)1 NewFormFactorModulePath (com.android.tools.idea.npw.deprecated.NewFormFactorModulePath)1 ScopedDataBinder (com.android.tools.idea.wizard.dynamic.ScopedDataBinder)1 ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableMap (com.google.common.collect.ImmutableMap)1