|
|
Re: Create files only once [message #1791135 is a reply to message #1791128] |
Sun, 24 June 2018 21:38 |
Márcio Koch Messages: 57 Registered: August 2013 |
Member |
|
|
It is not working for me, when I save my DSL file, the generated files which should be kept (OUTPUT_KEEPED configuration), are removed if exists and created otherwise.
class MklOutputConfigurationProvider extends OutputConfigurationProvider {
public static val DEFAULT_OUTPUT_DIRECTORY = "."
public static val APP_OUTPUT_DIRECTORY = DEFAULT_OUTPUT_DIRECTORY + "/modules/app/"
public static val OUTPUT_KEEPED = "OUTPUT_KEEPED"
override getOutputConfigurations() {
val defaultOutput = new OutputConfiguration(IFileSystemAccess.DEFAULT_OUTPUT)
defaultOutput.description = "Default and base output."
defaultOutput.outputDirectory = DEFAULT_OUTPUT_DIRECTORY
defaultOutput.createOutputDirectory = true
val outputConfigKeepResources = new OutputConfiguration(OUTPUT_KEEPED)
outputConfigKeepResources.description = "Keep generated files"
outputConfigKeepResources.outputDirectory = APP_OUTPUT_DIRECTORY
outputConfigKeepResources.createOutputDirectory = true
outputConfigKeepResources.overrideExistingResources = false
outputConfigKeepResources.setDerivedProperty = false
outputConfigKeepResources.canClearOutputDirectory = false
outputConfigKeepResources.cleanUpDerivedResources = false
newHashSet(defaultOutput, outputConfigKeepResources)
}
}
Debugging, Eclipse falls in this code that always associates the files with the DSL and deletes them, they seem to be always derived files:
public boolean installMarker(IFile file, String generator, String source) throws CoreException {
if (!file.exists())
return false;
IMarker[] markers = file.findMarkers(MARKER_ID, true, IResource.DEPTH_INFINITE);
for (IMarker marker : markers) {
if (generator.equals(marker.getAttribute(ATTR_GENERATOR))
&& source.equals(marker.getAttribute(ATTR_SOURCE)))
return true;
}
IMarker marker = file.createMarker(MARKER_ID);
marker.setAttribute(ATTR_GENERATOR, generator);
marker.setAttribute(ATTR_SOURCE, source);
return true;
}
I'm doing something wrong?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03428 seconds