Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ptp-dev] Trying to understand ETFWBuildTool

That ugliness arose mostly from the fact that the output/execution locations were potentially different between synchronized and unsynchronized projects. If a synchronized project doesn't explicitly set the output directory then the default output location is sometimes the user's home directory or a scratch directory, which is generally not what you want when you're generating a lot of performance data, so it was necessary to make the execution happen in the project directory which is where unsynchronized projects ran by default if I remember correctly.

There was a similar issue with the build path. I believe the PTP had different internal variables and a different way of storing the executable location so it was necessary to check for both the regular CDT location and the PTP/synchronized location. Things may have become more consistent now. I think I had been bitten by the storage method changing a couple times so I may have thrown in some redundant checks, probably at this point those are unnecessary. The build wait loop checks on both the programPah and the pathStore. One or the other of those will show up when the build is complete depending on the type of project.

I'm not sure about the full build check. Assuming the field does the same thing on both project types I think the behavior should be the same. I'm not sure why I would have made that distinction.

Regards,
Wyatt


On Fri, Jan 3, 2014 at 12:03 PM, Greg Watson <g.watson@xxxxxxxxxxxx> wrote:
Hi,

I’m trying to understand why org.eclipse.ptp.internal.etfw.ETFWBuildTool needs to distinguish between sync and non-sync projects. There are three places in the code where this happens:

1. initMMBuild() at line 283

If the project is not a sync project and the EXTOOL_EXECUTABLE_PATH_TAG attribute is set, then the outputLocation variable is set to a directory at the top level of the project with a name that is the build configuration name combined with a unique suffix.

If either of these is not true (i.e. it is a sync project or the attribute is not set), then the outputLocation variable remains the path to the project location (either remote or local).

Can someone explain why the outputLocation should be different for a sync project?

2. managedMakeBuild() at lines 449 and 484

This method defines two variables: programPath and pathStore. For a non-sync project, the former is an IFile object representing the name of the program that will be built, the latter is an IFileStore object representing the same file. For a sync project, only the pathStore variable is set. The programPath variable is null.

These variables are only used to test if the build has competed by polling programPath.exists() and pathStore.fetchInfo().exists(). If programPath is null (as in the case of a sync project), the method assumes the build never completes.

There are a few things about this I don’t understand:

a) Why distinguish between sync and non-sync projects?
b) Why test both programPath.exists() and pathStore.fetchInfo().exists()? Just checking pathStore.fetchInfo().exists() would work for both the sync and non-sync cases, and wouldn’t require the project to be refreshed in order to detect the build artifact.
c) By assuming the build is never completed when programPath is null, won’t the method never return if it is called for a sync project?

3. standardMakeBuild() at line 580

This method checks for any make targets called “all” and if found, invokes the builder for the target. If no target is found, a CLEAN_BUILD followed by a FULL_BUILD is invoked on the project. However for non-sync projects, a check is first made to see if the full build property is set, and the build only takes place if it is.

Can someone explain why the full build property is only checked for non-sync projects?

If anyone could help answer these questions, it would be appreciated.

Thanks,
Greg
_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev



Back to the top