This repository has been archived by the owner on Oct 16, 2024. It is now read-only.
forked from xhteam/tools-motodev
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bug 526437] - Android SWT Libraries need to be forked
1. Add Generic Category to Package Updater window 2. Add missing "Samples" PackageType 3. Add PackageFilter class to filter categories and package items according to package type 4. Add label to each PackageType enum for user package type selection 5. Add Package Updater option to select all new packages. Default is show only latest new packages. 6. On updater window, hilight obsolete checkbox when selected, add "obsolete" to affected package names and apply alert image 7. Extract version from package path, if appended and show this as package revision. 8. Remove version from package display name, if appended. 9. Add "Package Types..." and "Cancel" buttons to Package Updater window 10. Add handling of invalid Android SDK path setting in Package Updater window 11. Adjust Package Updater window column widths and change "Rev," to "Revision" 12. Change SwtBaseDialog to resize after setting contents 13. Convert SWT task framework to work asynchronously, executing tasks in jobs instead of threads 14. Add a "onTerminateTask" parameter to ITaskFactory to call back when the job is done 15. Add PackageInstaller and PackageInstallTask classes to encapsulate the package install steps 16. Add PackageInstallListener interface to call back on package install termination 17. Update SdkTargets class to associate targets with system images using AndroidTargetHash.getPlatformHashString() 18. Remove legacy code vestiges including disposal of image factories 19. Filter out duplicates which appear in the list of package dependencies produced by sdklib code 20. In AVD Manager, restrict target selection to only those targets with installed system images 21. Fix missing default AVD folder setting in AvdCreationPresenter 22. Add OK button to AVD Manager 23. Color ToggleButton background to make it look more like a button 24. Remove onSdkLoaded() event from ISdkChangeListener as it had no usage 25. Delay broadcast of ISdkChangeListener onSdkReload() event until updater window is closed 26. Complete design of AdtUpdateDialog to enhance user experience and enlist same package install code as used by updater window 27. Fix NPE in SdkTargetSelector and AVD manager caused by Target implementation change 28. Add image factory SdkUserInterfacePlugin and delegate it to dispose of the image factory 29. Add support to SdkContext for changing SDK location 30. Add to SdkHelper all ISdkChangeListener event broadcasts 31. Reinstate SdkManagerAction ISdkChangeListener events 32. Remove call to VersionCheck which fails for API27 because library file "plugin.prop" has disappeared 33. Two minor link check corrections for API25 and update of LintJob to workaround Eclipse projects not having "testsources" 34. Relocate commons-compress jar from sdkuilib module to swt module to fix classpath issue impacting package install 35. Fix spurious popup when cancelling AVD edit page Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=526437 Signed-off-by: Andrew Bowley <[email protected]>
- Loading branch information
Showing
67 changed files
with
5,660 additions
and
4,571 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ source.. = src/ | |
output.. = bin/ | ||
bin.includes = META-INF/,\ | ||
.,\ | ||
libs/,\ | ||
plugin.properties,\ | ||
icons/ | ||
|
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-357 KB
andmore-swt/org.eclipse.andmore.sdkuilib/libs/commons-compress-1.8.1.jar
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 0 additions & 42 deletions
42
...re.sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/ISdkUpdaterWindow.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...kuilib/src/main/java/com/android/sdkuilib/internal/repository/PackageInstallListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright (C) 2017 The Android Open Source Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
/** | ||
* | ||
*/ | ||
package com.android.sdkuilib.internal.repository; | ||
|
||
/** | ||
* @author Andrew Bowley | ||
* | ||
* 30-11-2017 | ||
*/ | ||
public interface PackageInstallListener { | ||
void onPackagesInstalled(int count); | ||
} |
132 changes: 132 additions & 0 deletions
132
...e.sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/PackageInstallTask.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
/* | ||
* Copyright (C) 2017 The Android Open Source Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
/** | ||
* | ||
*/ | ||
package com.android.sdkuilib.internal.repository; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Iterator; | ||
import java.util.List; | ||
|
||
import org.eclipse.andmore.sdktool.SdkContext; | ||
|
||
import com.android.repository.api.Installer; | ||
import com.android.repository.api.RemotePackage; | ||
|
||
/** | ||
* @author Andrew Bowley | ||
* | ||
* 29-11-2017 | ||
*/ | ||
public abstract class PackageInstallTask implements ITask, Runnable { | ||
|
||
private final SdkContext sdkContext; | ||
private final PackageManager packageManager; | ||
private final List<RemotePackage> packageList; | ||
private final List<RemotePackage> acceptedRemotes; | ||
private int numInstalled; | ||
|
||
/** | ||
* | ||
*/ | ||
public PackageInstallTask(SdkContext sdkContext, List<RemotePackage> packageList, List<RemotePackage> acceptedRemotes) { | ||
this.sdkContext = sdkContext; | ||
this.packageManager = sdkContext.getPackageManager(); | ||
this.packageList = packageList; | ||
this.acceptedRemotes = acceptedRemotes; | ||
} | ||
|
||
public int getNumInstalled() { | ||
return numInstalled; | ||
} | ||
|
||
/* (non-Javadoc) | ||
* @see com.android.sdkuilib.internal.repository.ITask#run(com.android.sdkuilib.internal.repository.ITaskMonitor) | ||
*/ | ||
@Override | ||
public void run(ITaskMonitor monitor) { | ||
// Assume installation will proceed instead of complicating the install task | ||
sdkContext.getSdkHelper().broadcastPreInstallHook(sdkContext.getSdkLog()); | ||
List<RemotePackage> rejectedRemotes = new ArrayList<>(); | ||
Iterator<RemotePackage> iterator = packageList.iterator(); | ||
while (iterator.hasNext()) { | ||
RemotePackage remote = iterator.next(); | ||
if (!acceptedRemotes.contains(remote)) | ||
rejectedRemotes.add(remote); | ||
} | ||
List<RemotePackage> remotes = new ArrayList<>(); | ||
remotes.addAll(packageList); | ||
if (!rejectedRemotes.isEmpty()) { | ||
String title = "Package licences not accepted"; | ||
StringBuilder builder = new StringBuilder(); | ||
builder.append("The following packages can not be installed since their " + | ||
"licenses or those of the packages they depend on were not accepted:"); | ||
Iterator<RemotePackage> iterator2 = rejectedRemotes.iterator(); | ||
while(iterator2.hasNext()) | ||
builder.append('\n').append(iterator2.next().getPath()); | ||
if (!acceptedRemotes.isEmpty()) { | ||
builder.append("\n\nContinue installing the remaining packages?"); | ||
if (!monitor.displayPrompt(title, | ||
builder.toString())) | ||
return; | ||
else { | ||
monitor.displayInfo(title, builder.toString()); | ||
return; | ||
} | ||
} | ||
remotes = acceptedRemotes; | ||
} | ||
final int progressPerPackage = 2 * 100; | ||
monitor.setProgressMax(1 + remotes.size() * progressPerPackage); | ||
monitor.setDescription("Preparing to install packages"); | ||
for (RemotePackage remotePackage : remotes) { | ||
int nextProgress = monitor.getProgress() + progressPerPackage; | ||
Installer installer = packageManager.createInstaller(remotePackage); | ||
if (packageManager.applyPackageOperation(installer)) { | ||
++numInstalled; | ||
} else { | ||
// there was an error, abort. | ||
monitor.error(null, "Install of package failed due to an error"); | ||
monitor.setProgressMax(0); | ||
break; | ||
} | ||
if (monitor.isCancelRequested()) { | ||
break; | ||
} | ||
monitor.incProgress(nextProgress - monitor.getProgress()); | ||
} | ||
if (numInstalled > 0) | ||
sdkContext.getSdkHelper().broadcastPostInstallHook(sdkContext.getSdkLog()); | ||
/* Post package install operations used to give the user an opportuning to restart ADB | ||
* and advise check for ADT Updates | ||
if (installedAddon || installedPlatformTools) { | ||
// We need to restart ADB. Actually since we don't know if it's even | ||
// running, maybe we should just kill it and not start it. | ||
// Note: it turns out even under Windows we don't need to kill adb | ||
// before updating the tools folder, as adb.exe is (surprisingly) not | ||
// locked. | ||
askForAdbRestart(monitor); | ||
} | ||
if (installedTools) { | ||
notifyToolsNeedsToBeRestarted(flags); | ||
} | ||
*/ | ||
} | ||
|
||
} |
Oops, something went wrong.