From e58842fe2e80d7446911ab82c1714c21a4d29343 Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Sun, 10 Mar 2024 12:27:53 -0400 Subject: [PATCH] Fix many of the review comments. --- .../builderTests/regressions/README.txt | 4 ++ .../regressions/helloworldCPP.zip | Bin 2910 -> 2660 bytes .../CompilationDatabaseGenerationTest.java | 67 +++++++----------- .../.project | 5 ++ .../META-INF/MANIFEST.MF | 1 + .../internal/core/CommonBuilder.java | 2 +- .../CompilationDatabaseGeneratorBlock.java | 17 ++--- .../JsonCdbGeneratorPreferencePage.java | 3 + .../JsonCdbGeneratorPropertyPage.java | 3 +- 9 files changed, 46 insertions(+), 56 deletions(-) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/builderTests/regressions/README.txt b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/builderTests/regressions/README.txt index 58b16439453..5368853f439 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/builderTests/regressions/README.txt +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/builderTests/regressions/README.txt @@ -3,5 +3,9 @@ helloworldC.zip: Basic standard Linux GCC C HelloWorld ManagedBuild Project template. Contains Debug + Release configurations. +helloworldCPP.zip: + Minimal standard Linux GCC C++ HelloWorld ManagedBuild Project template + Contains Debug + Release configurations. + bug_335476.zip: Test for noticing environment variable changes. \ No newline at end of file diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/builderTests/regressions/helloworldCPP.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/builderTests/regressions/helloworldCPP.zip index 1b7db76c4f1990e439ceeacb62758aec0553b70c..c92696a4e145eaa7d27eb9ebc4820fad1276d2ed 100644 GIT binary patch literal 2660 zcmb7`do)yQAIJAZ$(@wDm}J~F$=%3xT!-A55l+K|iD8CmXee}ZD>IbJFhcI5I&w*h zLBc_fQkV#d#x)_z^>E(PS?_tzIe)y*UeEeHd#z`Ep1nSM@AdmS+Hr91=Kz4cfO~v^ zXNrwB<^U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D{$6gxJ?XaWj)m>n7pa7((b)X;8ar_v6xja(9A0Zq7BjCJonwZjN606={+kc|}n!tZX`(cgb&vgDX89%t` zAIN|A#y`na*z1&If6Dh4|1&jIrsW@~f0q|OsT^49zz^zwWy$|{3<2SHq42TY4=dX5 I-|aKtUwT{Qg#Z8m diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/CompilationDatabaseGenerationTest.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/CompilationDatabaseGenerationTest.java index 98739c76c80..d44dc2c2530 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/CompilationDatabaseGenerationTest.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/CompilationDatabaseGenerationTest.java @@ -15,38 +15,34 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.FileReader; -import java.io.IOException; -import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin; import org.eclipse.cdt.managedbuilder.core.jsoncdb.CompilationDatabaseInformation; +import org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder; import org.eclipse.cdt.managedbuilder.testplugin.AbstractBuilderTest; import org.eclipse.cdt.managedbuilder.testplugin.ManagedBuildTestHelper; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.preferences.InstanceScope; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.ui.preferences.ScopedPreferenceStore; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; -import com.google.gson.JsonIOException; public class CompilationDatabaseGenerationTest extends AbstractBuilderTest { /** * Tests generation of compile_commands.json in "build" folder - * @throws CoreException */ @Test - public void testCompilationDatabaseGeneration() throws CoreException { + public void testCompilationDatabaseGeneration() throws Exception { setWorkspace("regressions"); final IProject app = loadProject("helloworldC"); - isGenerateFileOptionEnabled(true); + setGenerateFileOptionEnabled(true); app.build(IncrementalProjectBuilder.FULL_BUILD, null); IFile compilationDatabase = app.getFile("build/compile_commands.json"); assertTrue(compilationDatabase.exists()); @@ -54,14 +50,12 @@ public void testCompilationDatabaseGeneration() throws CoreException { /** * Tests format for compile_commands.json. JSON array is expected, containing an element for the c file - * @throws JsonIOException - * @throws CoreException */ @Test - public void testJsonFormat() throws JsonIOException, CoreException { + public void testJsonFormat() throws Exception { setWorkspace("regressions"); final IProject app = loadProject("helloworldC"); - isGenerateFileOptionEnabled(true); + setGenerateFileOptionEnabled(true); app.build(IncrementalProjectBuilder.FULL_BUILD, null); IFile commandsFile = app.getFile("build/compile_commands.json"); if (commandsFile.exists()) { @@ -69,7 +63,6 @@ public void testJsonFormat() throws JsonIOException, CoreException { try (FileReader reader = new FileReader(commandsFile.getLocation().toFile())) { Gson gson = new Gson(); JsonArray jsonArray = gson.fromJson(reader, JsonArray.class); - System.out.println(jsonArray); for (JsonElement element : jsonArray) { CompilationDatabaseInformation compileCommand = gson.fromJson(element, CompilationDatabaseInformation.class); @@ -80,8 +73,6 @@ public void testJsonFormat() throws JsonIOException, CoreException { assertTrue(compileCommand.file().endsWith("src/helloworldC.c")); } - } catch (IOException e) { - assertTrue(false); } } @@ -89,14 +80,13 @@ public void testJsonFormat() throws JsonIOException, CoreException { /** * Test that compile_commands.json is correctly generated when more than one .c file is present as a source file - * @throws CoreException */ @Test - public void testMultipleFiles() throws CoreException { + public void testMultipleFiles() throws Exception { setWorkspace("regressions"); final IProject app = loadProject("helloworldC"); IFile aFile = ManagedBuildTestHelper.createFile(app, "src/newFile.c"); - isGenerateFileOptionEnabled(true); + setGenerateFileOptionEnabled(true); app.build(IncrementalProjectBuilder.FULL_BUILD, null); IFile commandsFile = app.getFile("build/compile_commands.json"); int numberOfElementsFound = 0; @@ -120,31 +110,24 @@ public void testMultipleFiles() throws CoreException { assertEquals(2, numberOfElementsFound); assertTrue(helloworldCIsPresent); assertTrue(newFileIsPresent); - } catch (IOException e) { - assertTrue(false); } - } /** * Tests that cpp files are handled by compile_commands.json file generator - * @throws CoreException */ @Test - @Ignore("This will be temporary skipped due to builder error") - public void isCPPFileAllowed() throws CoreException { + public void isCPPFileAllowed() throws Exception { setWorkspace("regressions"); final IProject app = loadProject("helloworldCPP"); - isGenerateFileOptionEnabled(true); + setGenerateFileOptionEnabled(true); app.build(IncrementalProjectBuilder.FULL_BUILD, null); - System.out.println(app.getLocation()); IFile commandsFile = app.getFile("build/compile_commands.json"); if (commandsFile.exists()) { try (FileReader reader = new FileReader(commandsFile.getLocation().toFile())) { Gson gson = new Gson(); JsonArray jsonArray = gson.fromJson(reader, JsonArray.class); - System.out.println(jsonArray); for (JsonElement element : jsonArray) { CompilationDatabaseInformation compileCommand = gson.fromJson(element, CompilationDatabaseInformation.class); @@ -155,35 +138,33 @@ public void isCPPFileAllowed() throws CoreException { assertTrue(compileCommand.file().endsWith("src/helloworldCPP.cpp")); } - } catch (IOException e) { - assertTrue(false); } } } /** * Tests that compilation database is not generated when feature is disabled - * @throws CoreException */ @Test - public void testCompilationDatabaseGenerationNotEnabled() throws CoreException { + public void testCompilationDatabaseGenerationNotEnabled() throws Exception { setWorkspace("regressions"); final IProject app = loadProject("helloworldC"); - isGenerateFileOptionEnabled(false); + setGenerateFileOptionEnabled(false); app.build(IncrementalProjectBuilder.FULL_BUILD, null); IFile compilationDatabase = app.getFile("build/compile_commands.json"); assertFalse(compilationDatabase.exists()); } - public static boolean isGenerateFileOptionEnabled(boolean value) { - try { - IPreferenceStore preferenceStore = new ScopedPreferenceStore(InstanceScope.INSTANCE, - "org.eclipse.cdt.managedbuilder.ui"); //$NON-NLS-1$ - preferenceStore.setDefault("generateFile", value); - return preferenceStore.getBoolean("generateFile"); - } catch (Exception e) { - ManagedBuilderCorePlugin.log(e); - } - return false; + private static void setGenerateFileOptionEnabled(boolean value) { + IPreferenceStore preferenceStore = new ScopedPreferenceStore(InstanceScope.INSTANCE, + "org.eclipse.cdt.managedbuilder.ui"); + preferenceStore.setValue(CommonBuilder.COMPILATION_DATABASE_ENABLEMENT, value); + } + + @AfterEach + public void restoreDefaultForGenerateFile() { + IPreferenceStore preferenceStore = new ScopedPreferenceStore(InstanceScope.INSTANCE, + "org.eclipse.cdt.managedbuilder.ui"); + preferenceStore.setToDefault(CommonBuilder.COMPILATION_DATABASE_ENABLEMENT); } } diff --git a/build/org.eclipse.cdt.managedbuilder.core/.project b/build/org.eclipse.cdt.managedbuilder.core/.project index cab798d8b70..70542d7e9d9 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/.project +++ b/build/org.eclipse.cdt.managedbuilder.core/.project @@ -25,6 +25,11 @@ + + org.eclipse.pde.ds.core.builder + + + org.eclipse.jdt.core.javanature diff --git a/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF b/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF index d82ef0e4309..3d59b08efd7 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF +++ b/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF @@ -16,6 +16,7 @@ Export-Package: org.eclipse.cdt.build.core.scannerconfig, org.eclipse.cdt.managedbuilder.envvar, org.eclipse.cdt.managedbuilder.internal.buildmodel;x-friends:="org.eclipse.cdt.managedbuilder.ui", org.eclipse.cdt.managedbuilder.internal.core;x-friends:="org.eclipse.cdt.managedbuilder.ui,org.eclipse.cdt.managedbuilder.headlessbuilderapp", + org.eclipse.cdt.managedbuilder.internal.core.jsoncdb.generator;x-internal:=true, org.eclipse.cdt.managedbuilder.internal.dataprovider;x-internal:=true, org.eclipse.cdt.managedbuilder.internal.envvar;x-internal:=true, org.eclipse.cdt.managedbuilder.internal.language.settings.providers;x-friends:="org.eclipse.cdt.managedbuilder.ui", diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java index e0dab6f4188..58e9bd75771 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java @@ -97,7 +97,7 @@ public class CommonBuilder extends ACBuilder implements IIncrementalProjectBuild private static final String NEWLINE = System.getProperty("line.separator"); //$NON-NLS-1$ private static final String TRACE_FOOTER = "]: "; //$NON-NLS-1$ private static final String TRACE_HEADER = "GeneratedmakefileBuilder trace ["; //$NON-NLS-1$ - private static final String COMPILATION_DATABASE_ENABLEMENT = "generateFile"; //$NON-NLS-1$ + public static final String COMPILATION_DATABASE_ENABLEMENT = "generateCBDFile"; //$NON-NLS-1$ public static boolean VERBOSE = false; private static final int PROGRESS_MONITOR_SCALE = 100; diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/compilationdatabase/CompilationDatabaseGeneratorBlock.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/compilationdatabase/CompilationDatabaseGeneratorBlock.java index d100730449e..cf00edf4578 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/compilationdatabase/CompilationDatabaseGeneratorBlock.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/compilationdatabase/CompilationDatabaseGeneratorBlock.java @@ -9,6 +9,7 @@ ********************************************************************************/ package org.eclipse.cdt.managedbuilder.internal.ui.compilationdatabase; +import org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder; import org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin; import org.eclipse.cdt.ui.dialogs.AbstractCOptionPage; import org.eclipse.cdt.ui.dialogs.ICOptionContainer; @@ -33,15 +34,14 @@ */ public class CompilationDatabaseGeneratorBlock extends AbstractCOptionPage { - private static final String PREF_PAGE_ID = "org.eclipse.cdt.managedbuilder.internal.ui.compilationdatabase.JsonCdbGeneratorPreferencePage"; //$NON-NLS-1$ - private final String ENABLE_FILE_GENERATION = "generateFile"; //$NON-NLS-1$ + private static final String PREF_PAGE_ID = "org.eclipse.cdt.managedbuilder.ui.compilationdatabase.JsonCdbPreferencePage"; //$NON-NLS-1$ + private final String ENABLE_FILE_GENERATION = CommonBuilder.COMPILATION_DATABASE_ENABLEMENT; private Button generateFileCheckbox; private IPreferenceStore preferenceStore; private PreferenceScopeBlock fPrefScopeBlock; - protected CompilationDatabaseGeneratorBlock() { + public CompilationDatabaseGeneratorBlock() { preferenceStore = ManagedBuilderUIPlugin.getDefault().getPreferenceStore(); - performDefaults(); } @Override @@ -66,21 +66,16 @@ protected void onPreferenceScopeChange() { generateFileCheckbox = new Button(cdbGeneratorOptions, SWT.CHECK); generateFileCheckbox.setSelection(preferenceStore.getBoolean(ENABLE_FILE_GENERATION)); generateFileCheckbox.setText(Messages.JsonCdbGeneratorPreferencePage_generateCompilationdatabase); - generateFileCheckbox.addListener(SWT.Selection, e -> { - boolean newValue = generateFileCheckbox.getSelection(); - preferenceStore.setValue(ENABLE_FILE_GENERATION, newValue); - }); - } @Override public void performDefaults() { - preferenceStore.setDefault(ENABLE_FILE_GENERATION, false); + preferenceStore.setToDefault(ENABLE_FILE_GENERATION); } @Override public void performApply(IProgressMonitor monitor) throws CoreException { - this.performApply(monitor); + preferenceStore.setValue(ENABLE_FILE_GENERATION, generateFileCheckbox.getSelection()); } private IProject getProject() { diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/compilationdatabase/JsonCdbGeneratorPreferencePage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/compilationdatabase/JsonCdbGeneratorPreferencePage.java index 88c67a21db9..dc2361a25ce 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/compilationdatabase/JsonCdbGeneratorPreferencePage.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/compilationdatabase/JsonCdbGeneratorPreferencePage.java @@ -9,10 +9,12 @@ ********************************************************************************/ package org.eclipse.cdt.managedbuilder.internal.ui.compilationdatabase; +import org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin; import org.eclipse.cdt.ui.dialogs.ICOptionContainer; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.Status; import org.eclipse.jface.preference.PreferencePage; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; @@ -72,6 +74,7 @@ public boolean performOk() { try { fOptionBlock.performApply(new NullProgressMonitor()); } catch (CoreException e) { + ManagedBuilderUIPlugin.log(Status.error("Failed to save JSON Compilation Database Generator settings", e)); //$NON-NLS-1$ } return true; } diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/compilationdatabase/JsonCdbGeneratorPropertyPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/compilationdatabase/JsonCdbGeneratorPropertyPage.java index f4c55ec52a8..9817495d591 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/compilationdatabase/JsonCdbGeneratorPropertyPage.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/compilationdatabase/JsonCdbGeneratorPropertyPage.java @@ -17,6 +17,7 @@ import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Preferences; +import org.eclipse.core.runtime.Status; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; @@ -54,7 +55,7 @@ public boolean performOk() { try { optionPage.performApply(new NullProgressMonitor()); } catch (CoreException e) { - ManagedBuilderUIPlugin.log(e); + ManagedBuilderUIPlugin.log(Status.error("Failed to save JSON Compilation Database Generator settings", e)); //$NON-NLS-1$ } return true; }