Commit f091be45 authored by Andrey Filippov's avatar Andrey Filippov

Implemented build stamp generator, committed missed new files

parent f88dd96e
...@@ -142,9 +142,10 @@ public class VDT { ...@@ -142,9 +142,10 @@ public class VDT {
public static final String GENERATOR_ID_FILE_LIST = "FileList"; public static final String GENERATOR_ID_FILE_LIST = "FileList";
public static final String GENERATOR_ID_TOP_MODULE = "TopModule"; public static final String GENERATOR_ID_TOP_MODULE = "TopModule";
public static final String GENERATOR_ID_TOP_MODULES = "TopModules"; public static final String GENERATOR_ID_TOP_MODULES = "TopModules";
public static final String GENERATOR_ID_CURRENT_FILE = "CurrentFile"; public static final String GENERATOR_ID_OS_NAME = "OS";
public static final String GENERATOR_ID_SELECTED_FILE = "SelectedFile"; public static final String GENERATOR_ID_SELECTED_FILE = "SelectedFile";
public static final String GENERATOR_ID_CURRENT_FILE = "CurrentFile";
public static final String GENERATOR_ID_CURRENT_BASE = "CurrentFileBase"; public static final String GENERATOR_ID_CURRENT_BASE = "CurrentFileBase";
public static final String GENERATOR_ID_CHOSEN_ACTION = "ChosenActionIndex"; public static final String GENERATOR_ID_CHOSEN_ACTION = "ChosenActionIndex";
public static final String GENERATOR_ID_OS_NAME = "OS"; public static final String GENERATOR_ID_BUILD_STAMP = "BuildStamp";
} // class VDT } // class VDT
/*******************************************************************************
* Copyright (c) 2006 Elphel, Inc and Excelsior, LLC.
* This file is a part of Eclipse/VDT plug-in.
* Eclipse/VDT plug-in is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* Eclipse/VDT plug-in is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with Eclipse VDT plug-in; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*******************************************************************************/
package com.elphel.vdt.core.tools.generators;
import com.elphel.vdt.VDT;
import com.elphel.vdt.ui.variables.SelectedResourceManager;
public class BuildStampGenerator extends AbstractGenerator {
public static final String NAME = VDT.GENERATOR_ID_BUILD_STAMP;
public String getName() {
return NAME;
}
protected String[] getStringValues() {
return new String[] {SelectedResourceManager.getDefault().getBuildStamp()};
}
}
/*******************************************************************************
* Copyright (c) 2006 Elphel, Inc and Excelsior, LLC.
* This file is a part of Eclipse/VDT plug-in.
* Eclipse/VDT plug-in is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* Eclipse/VDT plug-in is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with Eclipse VDT plug-in; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*******************************************************************************/
package com.elphel.vdt.core.tools.generators;
import com.elphel.vdt.VDT;
import com.elphel.vdt.ui.variables.SelectedResourceManager;
public class ChosenActionGenerator extends AbstractGenerator {
public static final String NAME = VDT.GENERATOR_ID_CHOSEN_ACTION;
public String getName() {
return NAME;
}
protected String[] getStringValues() {
int choice=SelectedResourceManager.getDefault().getChosenAction();
return new String[] { ""+choice };
}
} //ChosenActionGenerator
/*******************************************************************************
* Copyright (c) 2006 Elphel, Inc and Excelsior, LLC.
* This file is a part of Eclipse/VDT plug-in.
* Eclipse/VDT plug-in is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* Eclipse/VDT plug-in is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with Eclipse VDT plug-in; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*******************************************************************************/
package com.elphel.vdt.core.tools.generators;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.ui.IPageLayout;
import com.elphel.vdt.VDT;
import com.elphel.vdt.ui.variables.SelectedResourceManager;
public class SelectedFileGenerator extends AbstractGenerator {
private static final String NAME = VDT.GENERATOR_ID_SELECTED_FILE;
// private boolean menuMode=false; // managing menu items, not running tool
public String getName() {
return NAME;
}
/*
public CurrentFileGenerator(boolean menuMode){
super();
this.menuMode=menuMode;
}
*/
/*
public void setMenuMode(boolean menuMode){
this.menuMode=menuMode;
}
*/
protected String[] getStringValues() {
IResource resource;
if (getMenuMode()) resource = SelectedResourceManager.getDefault().getViewSelectedResource(IPageLayout.ID_RES_NAV);
else resource = SelectedResourceManager.getDefault().getSelectedResource();
if((resource != null) && (resource.getType() == IResource.FILE))
return new String[] { ((IFile)resource).getLocation().toOSString() };
return new String[] { "" };
}
}
...@@ -33,7 +33,8 @@ public class SimpleGeneratorRecognizer implements Recognizer { ...@@ -33,7 +33,8 @@ public class SimpleGeneratorRecognizer implements Recognizer {
new SelectedFileGenerator(), new SelectedFileGenerator(),
new CurrentFileGenerator(), new CurrentFileGenerator(),
new CurrentFileBaseGenerator(), new CurrentFileBaseGenerator(),
new ChosenActionGenerator() new ChosenActionGenerator(),
new BuildStampGenerator()
}; };
public SimpleGeneratorRecognizer(){ public SimpleGeneratorRecognizer(){
......
...@@ -66,7 +66,8 @@ public class SelectedResourceManager implements IWindowListener, ISelectionListe ...@@ -66,7 +66,8 @@ public class SelectedResourceManager implements IWindowListener, ISelectionListe
private String fChosenTarget=null; // full path of the chosen (for action) resource or any string. Used to calculate CurrentFile, verilog file, ... private String fChosenTarget=null; // full path of the chosen (for action) resource or any string. Used to calculate CurrentFile, verilog file, ...
private IResource fChosenVerilogFile = null; // to keep fSelectedVerilogFile private IResource fChosenVerilogFile = null; // to keep fSelectedVerilogFile
private int fChosenAction=0; // Chosen variant of running the tool private int fChosenAction=0; // Chosen variant of running the tool
private long timestamp=0;
//
private SelectedResourceManager() { private SelectedResourceManager() {
IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbench workbench = PlatformUI.getWorkbench();
if (workbench != null) { //may be running headless if (workbench != null) { //may be running headless
...@@ -255,7 +256,17 @@ public class SelectedResourceManager implements IWindowListener, ISelectionListe ...@@ -255,7 +256,17 @@ public class SelectedResourceManager implements IWindowListener, ISelectionListe
else if (fChosenVerilogFile==null) else if (fChosenVerilogFile==null)
fChosenVerilogFile=fSelectedVerilogFile; fChosenVerilogFile=fSelectedVerilogFile;
} }
public String setBuildStamp(){
timestamp=System.nanoTime();
return getBuildStamp();
}
public String getBuildStamp(){
return ""+timestamp;
}
public String getChosenTarget() { public String getChosenTarget() {
return fChosenTarget; return fChosenTarget;
} }
......
...@@ -243,7 +243,7 @@ public class DesignFlowView extends ViewPart implements ISelectionListener { ...@@ -243,7 +243,7 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
} }
} }
System.out.println("fillContextMenu(), launchActions="+launchActions); // System.out.println("fillContextMenu(), launchActions="+launchActions);
// manager.add(new Separator()); // manager.add(new Separator());
// drillDownAdapter.addNavigationActions(manager); // drillDownAdapter.addNavigationActions(manager);
// Other plug-ins can contribute their actions here // Other plug-ins can contribute their actions here
...@@ -623,6 +623,7 @@ public class DesignFlowView extends ViewPart implements ISelectionListener { ...@@ -623,6 +623,7 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
if (tool != null) { if (tool != null) {
tool.setChoice(0); tool.setChoice(0);
SelectedResourceManager.getDefault().updateActionChoice(fullPath, choice); // Andrey SelectedResourceManager.getDefault().updateActionChoice(fullPath, choice); // Andrey
SelectedResourceManager.getDefault().setBuildStamp(); // Andrey
LaunchCore.launch( tool LaunchCore.launch( tool
, selectedResource.getProject() , selectedResource.getProject()
// , selectedResource.getFullPath().toString() ); // , selectedResource.getFullPath().toString() );
......
...@@ -67,7 +67,12 @@ ...@@ -67,7 +67,12 @@
<syntax name="DbgCurrentFileSyntax" format="echo &quot;%%CurrentFile&quot; ;" /> <syntax name="DbgCurrentFileSyntax" format="echo &quot;%%CurrentFile&quot; ;" />
<syntax name="DbgChosenActionIndexSyntax" format="echo &quot;index=%%ChosenActionIndex&quot; ;" /> <syntax name="DbgChosenActionIndexSyntax" format="echo &quot;index=%%ChosenActionIndex&quot; ;" />
<syntax name="BuildStampSyntax" format="%%BuildStamp" />
<syntax name="LogFileSyntax" format="%%BuildStamp.log" />
<syntax name="GrepSkipSyntax" format="| grep --line-buffered -v &quot;%%ParamValue&quot;" />
//
ChosenActionIndex ChosenActionIndex
...@@ -283,7 +288,7 @@ ...@@ -283,7 +288,7 @@
label = "Filter_String" label = "Filter_String"
type = "StringType" type = "StringType"
format = "JustValueSyntax" format = "JustValueSyntax"
default = "2&gt;&amp;1 | tee iverilog.log | grep --line-buffered -E 'error|warning' | grep --line-buffered -v &quot;(null):0&quot;" default = "2&gt;&amp;1 | tee %LogFile | grep --line-buffered -E 'error|warning' | grep --line-buffered -v &quot;(null):0&quot;"
readonly = "false" readonly = "false"
visible = "true"/> visible = "true"/>
...@@ -305,12 +310,22 @@ ...@@ -305,12 +310,22 @@
readonly = "false" readonly = "false"
visible = "true"/> visible = "true"/>
<parameter id = "GrepSkip1"
label = "GrepSkip"
type = "StringType"
format = "GrepSkipSyntax"
default = "(null)"
readonly = "false"
visible = "true"/>
<!-- intentional error below - duplicate --> <!-- intentional error below - duplicate -->
<parameter id = "BuildDir" <parameter id = "LogFile"
label = "project build directory" label = "Simulator Log Filie"
type = "DirType" type = "StringType"
default = "build1" default = "logfile.log"
format = "ValueSyntax" format = "LogFileSyntax"
readonly= "false" /> readonly= "false" />
...@@ -328,6 +343,7 @@ ...@@ -328,6 +343,7 @@
<group name="options" label="Options"> <group name="options" label="Options">
"ErrorsOnly" "ErrorsOnly"
"Filter_String" "Filter_String"
"GrepSkip1"
"v" "v"
"LegacyModel" "LegacyModel"
"NoSpecify" "NoSpecify"
...@@ -343,6 +359,7 @@ ...@@ -343,6 +359,7 @@
"echo CurrentFile=%%CurrentFile ;" "echo CurrentFile=%%CurrentFile ;"
"echo SimulationTopFile=%SimulationTopFile ;" "echo SimulationTopFile=%SimulationTopFile ;"
"echo SimulationTopModule=%SimulationTopModule ;" "echo SimulationTopModule=%SimulationTopModule ;"
"echo LogFile=%LogFile ;"
"%Param_PreExe" "%Param_PreExe"
"%Param_Exe" "%Param_Exe"
"%Param_TopModule" "%Param_TopModule"
...@@ -354,7 +371,11 @@ ...@@ -354,7 +371,11 @@
"%SourceList" "%SourceList"
"%ExtraFiles" "%ExtraFiles"
<if ErrorsOnly="true"> <if ErrorsOnly="true">
"%Filter_String" "2&gt;&amp;1"
"| tee %LogFile"
"| grep --line-buffered -E 'error|warning'"
"%GrepSkip1"
<!-- "%Filter_String" -->
</if> </if>
</line> </line>
</output> </output>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment