📄 commandline.vb
字号:
''' /resource:<resinfo> Adds the specified file as an embedded assembly resource. resinfo:<file>[,<name>[,public|private]] (Short form: /res) ''' </summary> ReadOnly Property Resources() As Resources Get Return m_lstResources End Get End Property ''' <summary> ''' /win32icon:<file> Specifies a Win32 icon file (.ico) for the default Win32 resources. ''' </summary> ReadOnly Property Win32Icon() As String Get Return m_strWin32Icon End Get End Property ''' <summary> ''' /win32resource:<file> Specifies a Win32 resource file (.res). ''' </summary> ReadOnly Property Win32Resource() As String Get Return m_strWin32Resource End Get End Property ' - CODE GENERATION - ''' <summary> ''' /optimize[+|-] Enable optimizations. ''' </summary> ReadOnly Property Optimize() As Boolean Get Return m_bOptimize End Get End Property ''' <summary> ''' /removeintchecks[+|-] Remove integer checks. Default off. ''' </summary> ReadOnly Property RemoveIntChecks() As Boolean Get Return m_bRemoveIntChecks End Get End Property ''' <summary> '''/debug:full Emit full debugging information (default). '''/debug:pdbonly Emit PDB file only. ''' </summary> ReadOnly Property DebugInfo() As DebugTypes Get Return m_eDebugInfo End Get End Property ' - ERRORS AND WARNINGS - ''' <summary> ''' /nowarn Disable warnings. ''' </summary> ReadOnly Property NoWarn() As Boolean Get Return m_bNoLogo End Get End Property ''' <summary> ''' /warnaserror[+|-] Treat warnings as errors. ''' </summary> ReadOnly Property WarnAsError() As Boolean Get Return m_bWarnAsError End Get End Property ' - LANGUAGE - ''' <summary> ''' /define:<symbol_list> Declare global conditional compilation symbol(s). symbol_list:name=value,... (Short form: /d) ''' </summary> ReadOnly Property Define() As Defines Get Return m_lstDefine End Get End Property ''' <summary> ''' /imports:<import_list> Declare global Imports for namespaces in referenced metadata files. import_list:namespace,... ''' </summary> ReadOnly Property [Imports]() As ImportsStatement Get Return m_lstImports End Get End Property ''' <summary> ''' /optionexplicit[+|-] Require explicit declaration of variables. ''' </summary> ReadOnly Property OptionExplicit() As OptionExplicitTypes Get Return m_eOptionExplicit End Get End Property ''' <summary> ''' /optionstrict[+|-] Enforce strict language semantics. ''' </summary> ReadOnly Property OptionStrict() As OptionStrictTypes Get Return m_eOptionStrict End Get End Property ''' <summary> ''' /rootnamespace:<string> Specifies the root Namespace for all type declarations. ''' </summary> ReadOnly Property RootNamespace() As String Get Return m_strRootNamespace End Get End Property ''' <summary> '''/optioncompare:binary Specifies binary-style string comparisons. This is the default. '''/optioncompare:text Specifies text-style string comparisons. ''' </summary> ReadOnly Property OptionCompare() As OptionCompareTypes Get Return m_eOptionCompare End Get End Property ' - MISCELLANEOUS - ''' <summary> ''' /help Display this usage message. (Short form: /?) ''' </summary> ReadOnly Property Help() As Boolean Get Return m_bHelp End Get End Property ''' <summary> ''' /nologo Do not display compiler copyright banner. ''' </summary> ReadOnly Property NoLogo() As Boolean Get Return m_bNoLogo End Get End Property ''' <summary> ''' /quiet Quiet output mode. ''' </summary> ReadOnly Property Quiet() As Boolean Get Return m_bQuiet End Get End Property ''' <summary> ''' /verbose Display verbose messages. ''' </summary> ReadOnly Property Verbose() As Boolean Get Return m_bVerbose End Get End Property ''' <summary> ''' /noconfig Disable the automatic inclusion of the vbnc.rsp response file. ''' </summary> ReadOnly Property NoConfig() As Boolean Get Return m_bNoConfig End Get End Property ReadOnly Property NoVBRuntimeRef() As Boolean Get Return m_NoVBRuntimeRef End Get End Property ' - ADVANCED - ''' <summary> ''' /baseaddress:<number> The base address for a library or module (hex). ''' </summary> ReadOnly Property BaseAddress() As String Get Return m_strBaseAddress End Get End Property ''' <summary> ''' /bugreport:<file> Create bug report file. ''' </summary> ReadOnly Property BugReport() As String Get Return m_strBugReport End Get End Property ''' <summary> ''' /codepage:<number> Specifies the codepage to use when opening source files. ''' </summary> ReadOnly Property Encoding() As System.Text.Encoding Get If m_Encoding Is Nothing Then m_Encoding = System.Text.Encoding.Default Return m_Encoding End Get End Property ''' <summary> ''' /delaysign[+|-] Delay-sign the assembly using only the public portion of the strong name key. ''' </summary> ReadOnly Property DelaySign() As Boolean Get Return m_bDelaySign End Get End Property ''' <summary> ''' /keycontainer:<string> Specifies a strong name key container. ''' </summary> ReadOnly Property KeyContainer() As String Get Return m_strKeyContainer End Get End Property ''' <summary> ''' /keyfile:<file> Specifies a strong name key file. ''' </summary> ReadOnly Property KeyFile() As String Get Return m_strKeyFile End Get End Property ''' <summary> ''' /libpath:<path_list> List of directories to search for metadata references. (Semi-colon delimited.)' ''' </summary> ReadOnly Property LibPath() As Specialized.StringCollection Get Return m_lstLibPath End Get End Property ''' <summary> ''' /main:<class> Specifies the Public Class or Module that contains Sub Main. It can also be a Public Class that inherits from System.Windows.Forms.Form. (Short form: /m) ''' </summary> ReadOnly Property Main() As String Get Return m_strMain End Get End Property ''' <summary> ''' /netcf Target the .NET Compact Framework. ''' </summary> ReadOnly Property NetCF() As Boolean Get Return m_bNetCF End Get End Property ''' <summary> ''' /sdkpath:<path> Location of the .NET Framework SDK directory (mscorlib.dll). ''' </summary> ReadOnly Property SDKPath() As String Get Return m_strSDKPath End Get End Property ''' <summary> ''' /utf8output[+|-] Emit compiler output in UTF8 character encoding. ''' </summary> ReadOnly Property UTF8Output() As Boolean Get Return m_bUTF8Output End Get End Property ''' <summary> ''' A list of all the response files specified on the command line. ''' </summary> ReadOnly Property ResponseFiles() As Specialized.StringCollection Get Return m_lstResponseFiles End Get End Property#If DEBUG Then ReadOnly Property Dumping() As Boolean Get Return m_bDumping End Get End Property ReadOnly Property StopAfter() As String Get If m_StopAfter Is Nothing Then m_StopAfter = "" Return m_StopAfter End Get End Property#End If#End Region ReadOnly Property AllArgumentsAsArray() As String() Get Dim result(m_lstAllArgs.Count - 1) As String m_lstAllArgs.CopyTo(result, 0) Return result End Get End Property ''' <summary> ''' This property returns the files the commandline parser found on the commandline, ''' this includes expanded wildcards. ''' </summary> ''' <value></value> ''' <remarks></remarks> ReadOnly Property Files() As CodeFiles Get Return m_lstFileNames End Get End Property ''' <summary> ''' Create a new commandline parser! ''' </summary> ''' <remarks></remarks> Sub New(ByVal Compiler As Compiler) m_Compiler = Compiler m_lstImports = New ImportsStatement(Compiler) m_lstImports.Init(New ImportsClauses(m_lstImports)) m_lstFileNames = New CodeFiles(m_Compiler) m_lstResources = New Resources(m_Compiler) m_lstLinkResources = New Resources(m_Compiler) End Sub ''' <summary> ''' Parse the specified arguments ''' </summary> ''' <returns></returns> ''' <remarks></remarks> Function Parse(ByVal CommandLine As String()) As Boolean Dim result As Boolean = True Try result = ParseInternal(CommandLine) AndAlso result If m_bNoConfig = False Then Dim defaultrspfile As String defaultrspfile = IO.Path.Combine(IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly.Location), "vbnc.rsp") If IO.File.Exists(defaultrspfile) = False Then Try Using resources As System.IO.Stream = Reflection.Assembly.GetExecutingAssembly.GetManifestResourceStream("vbnc.vbnc.rsp") If resources IsNot Nothing Then Using reader As New IO.StreamReader(resources) Dim tmp As String = reader.ReadToEnd() IO.File.WriteAllText(defaultrspfile, tmp) End Using End If End Using Catch ex As Exception 'Ignore any exceptions here. End Try End If If IO.File.Exists(defaultrspfile) Then result = ParseResponseFile(defaultrspfile) AndAlso result Else Compiler.Report.WriteLine(vbnc.Report.ReportLevels.Debug, "Default response file '" & defaultrspfile & "' was not loaded because it couldn't be found.") End If End If Catch ex As Exception Helper.StopIfDebugging() Throw End Try Return result End Function ''' <summary> ''' Reads the specified response file and sends the arguments to pParse. ''' </summary> Private Function ParseResponseFile(ByVal Filename As String) As Boolean If m_lstResponseFiles.Contains(Filename) Then Compiler.Report.ShowMessage(Messages.VBNC2014, Filename) Return False Else m_lstResponseFiles.Add(Filename) End If Dim lstArgs As New Specialized.StringCollection Dim strLines As String() If IO.File.Exists(Filename) Then 'Do nothing Filename = IO.Path.GetFullPath(Filename) ElseIf IO.File.Exists(IO.Path.GetFullPath(Filename)) Then Filename = IO.Path.GetFullPath(Filename) Else#If DEBUG Then Compiler.Report.WriteLine("IO.File.Exists(" & Filename & ") => " & IO.File.Exists(Filename).ToString) Compiler.Report.WriteLine("IO.File.Exists(" & IO.Path.GetFullPath(Filename) & ") >= " & IO.File.Exists(IO.Path.GetFullPath(Filename)).ToString)#End If Compiler.Report.ShowMessage(Messages.VBNC2001, Filename) Return False End If Helper.Assert(IO.File.Exists(Filename))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -