Hi All,

I have worked this issue [0] and made a progress. I created an custom ant
task and execute it. But there are few things i need to clarify before I
continue.

Current Car Export method (*
org.wso2.carbonstudio.eclipse.capp.project.utils.CAppUtils.generateCAR(...)*)
requires 3 input parameters as String savePath, IProject selectedProject,
boolean stratosEnabled. But if we are going to build the C-App from command
line, it is bit problematic to get the value of the selectedProject as it is
an Eclipse Workspace related information and when we are using the command
line, we don't have the access to the workspace. If we try to use Eclipse
Resource API, we get an IllegalStateException saying that workspace is
closed.

IMHO first, i don't think it is a good practice to expect Eclipse Specific
data from a command line user and second, i don't think we have a mechanism
of retrieving that data unless we read the .project file. Even though we
read and get the project name, it would not be that easy to provide it as an
IProject type parameter since it is an Eclipse Resource API related. Even if
we provide that as an IProject type parameter, we cannot execute Eclipse
runtime related code from command line. For example, if we try to execute "*
ResourcesPlugin.getWorkspace().getRoot().getProject()*" from console, this
gives the same IllegalStateException for workspace. Therefore we need an
alternative. Hence, I propose that we use some Eclipse unrelated mechanism
to Car Export process. This needs to be a minor API change. I propose, we
provide the Location of the project. Then we can retrieve the
root-artifact.xml file and retrieve information about all the existing
artifacts from it and export them as a car file. WDYT?

[0]. https://wso2.org/jira/browse/TOOLS-376

-- 
Harshana Martin
Software Engineer
WSO2 Inc.
Web:http://wso2.com

Mobile: +94 716062650
Blog: http://harshana05.blogspot.com
Profile: https://www.google.com/profiles/harshana05
_______________________________________________
Carbon-dev mailing list
[email protected]
https://wso2.org/cgi-bin/mailman/listinfo/carbon-dev

Reply via email to