diff --git a/com.ibm.wala.core.tests/META-INF/MANIFEST.MF b/com.ibm.wala.core.tests/META-INF/MANIFEST.MF index deccade58..5281d0d5b 100644 --- a/com.ibm.wala.core.tests/META-INF/MANIFEST.MF +++ b/com.ibm.wala.core.tests/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: WALA Tests Plug-in -Bundle-SymbolicName: com.ibm.wala.core.tests +Bundle-SymbolicName: com.ibm.wala.core.tests;singleton:=true Bundle-Version: 1.0.0 Bundle-Vendor: IBM Bundle-Localization: plugin @@ -13,5 +13,6 @@ Export-Package: com.ibm.wala.core.tests.basic, com.ibm.wala.core.tests.cha, com.ibm.wala.core.tests.ir, com.ibm.wala.core.tests.util, + com.ibm.wala.eclipse.headless, com.ibm.wala.examples.drivers, com.ibm.wala.examples.properties diff --git a/com.ibm.wala.core.tests/build.properties b/com.ibm.wala.core.tests/build.properties index c7886205e..22ddb249b 100644 --- a/com.ibm.wala.core.tests/build.properties +++ b/com.ibm.wala.core.tests/build.properties @@ -2,4 +2,5 @@ source.. = src/,\ dat/ output.. = bin/ bin.includes = META-INF/,\ - . + .,\ + plugin.xml diff --git a/com.ibm.wala.core.tests/src/com/ibm/wala/eclipse/headless/Main.java b/com.ibm.wala.core.tests/src/com/ibm/wala/eclipse/headless/Main.java new file mode 100644 index 000000000..f5135b69d --- /dev/null +++ b/com.ibm.wala.core.tests/src/com/ibm/wala/eclipse/headless/Main.java @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright (c) 2007 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package com.ibm.wala.eclipse.headless; + +import java.util.Collection; + +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IPlatformRunnable; +import org.eclipse.jdt.core.IJavaProject; + +import com.ibm.wala.eclipse.util.EclipseProjectPath; +import com.ibm.wala.eclipse.util.JdtUtil; + +/** + * A dummy main class that runs WALA in a headless Eclipse platform. + * + * This is for expository purposes, and tests some WALA eclipse functionality. + * + * It appears (sigh) that IPlatformRunnable will be deprecated in Eclipse 3.3 + * and replaced by IApplication. Oh well. Going with the 3.2 API for now. + * + * @author sjfink + * + */ +public class Main implements IPlatformRunnable { + + public Object run(Object args) throws Exception { + Collection jp = JdtUtil.getWorkspaceJavaProjects(); + IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); + IPath workspaceRootPath = workspaceRoot.getLocation(); + for (IJavaProject p : jp) { + System.out.println(p); + EclipseProjectPath path = EclipseProjectPath.make(workspaceRootPath, p); + System.out.println("Path: " + path); + } + return null; + } +}