From b9f56ca8de3f25725fb260bd0a30073426eb834c 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. --- .../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 +- 8 files changed, 42 insertions(+), 56 deletions(-) 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..220388a78306126fad1ab3a87727c4263d938455 100644 GIT binary patch literal 2660 zcmb7`c{tSDAIHDbDA`Hb#Ux|bB)gGyWN&OSBit}yVwhnX424p*GDE2>Bf9ocU0IT1 zkPvc}vP8(Gu_i=~?Kked?(^&Z?)~F;&U2pkInQ&R*E!Goe811<0tDUf@)u zpIeHR7Ulpa0NgkV09*h7sQZKvg0UE%usL`4^mLe5^gFLc*l}jDCKqU*JF(LJfeVRV zQV07k8%HQy#5``K7xD8*JrPeJPjRlh4A?dAfidRXg>^D|$n%AzW`_ro zWC~i38ZAD{iahMPhXgjVe>@ghGG>t`8Qe7ba5jV??8?HIGDI-08}C|p(zz$Ce#3zJ znm%?n+xc^ybVBI2lRa-g#vRVsR8Cjrd`sYu@NK)iYx%?33!~zggkSdEX*3FL9uIzW z(?pQLVQkBjovXKBTC~;bWwSa}8-7dvfe00xp`kUIS|3Rl@U99K*K9P^^5Trx@>a#d z)2jXKsxdqZu#WIE+;74#^LjpW*I`SPYakmF0PWZYk@?jpFh zktBzwx^OPD244qpJhb*+FAbe&bi(NCzNmZcTN@rnw4zQF!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t`^&8CTm>}bwT&JyT8YBmx@S1Abp%gzjH*fqr!foNqw@2UWX|W}|k*RCA z+L~^;P{@Bt-(6QVo5*w{{b06#bZ0hZwq5-yp(=aP^)v%=B#T zqiyp-?nv+(zFoarX&`yR*uw3qoIU=vE>)B!W+gUFxVQjrQrk6r1#9 zlxlG8mhy5m&xiZ;&??HwfXjZ87}=9O$h7&^BLC~iqbs7etM3KeH_uig9t6GcZneD- zw7hiYj3mj}RXp#Uu#~PTYPA{_4C}AXoI{MKUF0oI1r(LGL_{t5;?!--T1SSNN}PI? zT|ko`wgL41QgO+ivz$=l000_z-)k_o;{GVO4Td^UJRp^v`(mWak)@J1+nR)L@~x4Q zGd!wi@yITxEaS-5cI4!<P}N4Vmoi9aTt~7)GO1Msi1bXANeqtwPo}p;yB?W!QMYc!8TkoC zC|lLY28EF_fy7JWq9JY6`wZKH+|5uMO(ObzOw`b_qIL+b6Tsq>FpgO@lPS7N*mvo+ zG)!uad}xsWW(-LG6>8p4)fMLO0FDrvBH;}AZpDmaV2-+6mmU)E}fKO|Gv01^>*|CzX1!2GRC*A zubXsVG2EAg{r6lH?CL8D6P=OsuOT7T^huDjD{$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..b4dd2adc559 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 + private 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; }