Browse Source

Fixed SD2-497: Allow adding existing files as links.

Boo.Microsoft.Build.Tasks now can embed .resource files.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@620 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
db62adff59
  1. 41
      src/AddIns/BackendBindings/Boo/Boo.Microsoft.Build.Tasks/Boo.Microsoft.Build.Tasks.booproj
  2. 212
      src/AddIns/BackendBindings/Boo/Boo.Microsoft.Build.Tasks/Boo.Microsoft.Build.targets
  3. 354
      src/AddIns/BackendBindings/Boo/Boo.Microsoft.Build.Tasks/Booc.boo
  4. 42
      src/AddIns/BackendBindings/Boo/Boo.Microsoft.Build.Tasks/CreateBooManifestResourceName.boo
  5. 67
      src/AddIns/BackendBindings/Boo/Boo.Microsoft.Build.Tasks/Project.booproj
  6. 70
      src/AddIns/BackendBindings/Boo/Boo.Microsoft.Build.Tasks/Properties/AssemblyInfo.boo
  7. 6
      src/AddIns/BackendBindings/Boo/BooBinding.sln
  8. 2
      src/AddIns/BackendBindings/Boo/BooBinding/Project/PostBuildEvent.bat
  9. 2
      src/AddIns/DisplayBindings/ResourceEditor/Project/ResourceEditor.addin
  10. 2
      src/AddIns/DisplayBindings/ResourceEditor/Project/Src/ResourceEdit/ResourceList.cs
  11. 32
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/DefaultFileNodeCommands.cs
  12. 35
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/FolderNodeCommands.cs
  13. 2
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/ReferenceFolderNodeCommands.cs
  14. 4
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/AbstractProjectBrowserTreeNode.cs
  15. 5
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/DirectoryNode.cs
  16. 20
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/FileNode.cs
  17. 7
      src/Main/Base/Project/Src/Project/Items/FileProjectItem.cs
  18. 2
      src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs
  19. 10
      src/Main/Base/Project/Src/TextEditor/Commands/ClassBookmarkMenuBuilder.cs
  20. BIN
      src/Main/StartUp/Project/Resources/StringResources.resources

41
src/AddIns/BackendBindings/Boo/Boo.Microsoft.Build.Tasks/Boo.Microsoft.Build.Tasks.booproj

@ -0,0 +1,41 @@ @@ -0,0 +1,41 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OutputType>Library</OutputType>
<RootNamespace>Boo.Microsoft.Build.Tasks</RootNamespace>
<AssemblyName>Boo.Microsoft.Build.Tasks</AssemblyName>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{366B4AFE-C4E9-46DF-9CFF-57C62D414D4A}</ProjectGuid>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputPath>bin\Debug\</OutputPath>
<Optimize>False</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugSymbols>True</DebugSymbols>
<DebugType>Full</DebugType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputPath>bin\Release\</OutputPath>
<Optimize>True</Optimize>
<DefineConstants>TRACE</DefineConstants>
<DebugSymbols>False</DebugSymbols>
<DebugType>None</DebugType>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Build.Framework, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.Build.Utilities, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</ItemGroup>
<ItemGroup>
<Compile Include="Booc.boo" />
<Compile Include="Properties\AssemblyInfo.boo" />
<Compile Include="CreateBooManifestResourceName.boo" />
</ItemGroup>
<ItemGroup>
<Content Include="Project.booproj" />
<Content Include="Boo.Microsoft.Build.targets">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(BooBinPath)\Boo.Microsoft.Build.targets" />
</Project>

212
src/AddIns/BackendBindings/Boo/Boo.Microsoft.Build.Tasks/Boo.Microsoft.Build.targets

@ -0,0 +1,212 @@ @@ -0,0 +1,212 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask
TaskName="Microsoft.Build.Tasks.CreateBooManifestResourceName"
AssemblyFile="Boo.Microsoft.Build.Tasks.dll" />
<UsingTask
TaskName="Boo.Microsoft.Build.Tasks.Booc"
AssemblyFile="Boo.Microsoft.Build.Tasks.dll"/>
<PropertyGroup>
<MSBuildAllProjects Condition="'$(BoocToolPath)' != ''">
$(MSBuildAllProjects);$(BoocToolPath)\Boo.Microsoft.Build.targets
</MSBuildAllProjects>
<MSBuildAllProjects Condition="'$(BoocToolPath)' == ''">
$(MSBuildAllProjects);$(MSBuildBinPath)\Boo.Microsoft.Build.targets
</MSBuildAllProjects>
<DefaultLanguageSourceExtension>.boo</DefaultLanguageSourceExtension>
<Language>Boo</Language>
</PropertyGroup>
<!--
The CreateManifestResourceNames target create the manifest resource names
from the .RESX files.
[IN]
@(ResxWithNoCulture) - The names the non-culture .RESX files.
@(ResxWithCulture) - The names the culture .RESX files.
@(NonResxWithNoCulture) - The names of the non-culture non-RESX
files (like bitmaps, etc).
@(NonResxWithCulture) - The names of the culture non-RESX
files (like bitmaps, etc).
[OUT]
@(ManifestResourceWithNoCultureName) - The corresponding manifest
resource name (.RESOURCE)
@(ManifestResourceWithCultureName) - The corresponding manifest
resource name (.RESOURCE)
@(ManifestNonResxWithNoCulture) - The corresponding manifest
resource name.
@(ManifestNonResxWithCulture) - The corresponding manifest
resource name.
For Boo applications the transformation is like:
Resources1.resx => RootNamespace.Resources1 => Build into main assembly
SubFolder\Resources1.resx =>
RootNamespace.SubFolder.Resources1 =>
Build into main assembly
Resources1.fr.resx =>
RootNamespace.Resources1.fr =>
Build into satellite assembly
Resources1.notaculture.resx =>
RootNamespace.Resources1.notaculture =>
Build into main assembly
For other project systems, this transformation may be different.
-->
<PropertyGroup>
<CreateManifestResourceNamesDependsOn>
</CreateManifestResourceNamesDependsOn>
</PropertyGroup>
<Target
Name="CreateManifestResourceNames"
Condition="'
@(ResxWithNoCulture)
@(ResxWithCulture)
@(NonResxWithNoCulture)
@(NonResxWithCulture)'!=''"
DependsOnTargets="$(CreateManifestResourceNamesDependsOn)"
>
<!-- Create the target resource names for non-culture resx files -->
<CreateBooManifestResourceName
Condition="'@(ResxWithNoCulture)'!=''"
ResourceFiles="@(ResxWithNoCulture)"
RootNamespace="$(RootNamespace)">
<Output
TaskParameter="ManifestResourceNames"
ItemName="ManifestResourceWithNoCultureName"/>
</CreateBooManifestResourceName>
<!-- Create the target resource names for culture resx files. -->
<CreateBooManifestResourceName
Condition="'@(ResxWithCulture)'!=''"
ResourceFiles="@(ResxWithCulture)"
RootNamespace="$(RootNamespace)">
<Output
TaskParameter="ManifestResourceNames"
ItemName="ManifestResourceWithCultureName"/>
</CreateBooManifestResourceName>
<!-- Create the target resource names for non-culture non-resx files. -->
<CreateBooManifestResourceName
Condition="'@(NonResxWithNoCulture)'!=''"
ResourceFiles="@(NonResxWithNoCulture)"
RootNamespace="$(RootNamespace)">
<Output
TaskParameter="ManifestResourceNames"
ItemName="ManifestNonResxWithNoCulture"/>
</CreateBooManifestResourceName>
<!-- Create the target resource names for culture non-resx files. -->
<CreateBooManifestResourceName
Condition="'@(NonResxWithCulture)'!=''"
ResourceFiles="@(NonResxWithCulture)"
RootNamespace="$(RootNamespace)">
<Output
TaskParameter="ManifestResourceNames"
ItemName="ManifestNonResxWithCulture"/>
</CreateBooManifestResourceName>
</Target>
<PropertyGroup>
<!--
"None" is not technically a valid DebugType, so we can't pass it
in as such to the compiler. So here, we modify the properties so
they make sense.
-->
<DebugSymbols Condition="'$(DebugType)' == 'none'">false</DebugSymbols>
<DebugType Condition="'$(DebugType)' == 'none'"></DebugType>
<!-- Provide a facility to override UseHostCompilerIfAvailable-->
<UseHostCompilerIfAvailable
Condition="'$(UseHostCompilerIfAvailable)' == ''">
true
</UseHostCompilerIfAvailable>
</PropertyGroup>
<!--
These two compiler warnings are raised when a reference is bound to
a different version than specified in the assembly reference version
number. MSBuild raises the same warning in this case, so the compiler
warning would be redundant.
-->
<PropertyGroup Condition="'$(TargetFrameworkVersion)' != 'v1.0'">
<NoWarn Condition="'$(NoWarn)' != ''">$(NoWarn);</NoWarn>
<NoWarn>$(NoWarn)1701;1702</NoWarn>
</PropertyGroup>
<ItemGroup>
<DocFileItem
Include="$(DocumentationFile)"
Condition="'$(DocumentationFile)'!=''">
<InProject>false</InProject>
</DocFileItem>
</ItemGroup>
<PropertyGroup>
<CoreCompileDependsOn>
_ComputeNonExistentFileProperty
</CoreCompileDependsOn>
</PropertyGroup>
<Target
Name="CoreCompile"
Inputs="$(MSBuildAllProjects);
@(Compile);
@(ManifestResourceWithNoCulture);
$(ApplicationIcon);
$(AssemblyOriginatorKeyFile);
@(ManifestNonResxWithNoCultureOnDisk);
@(ReferencePath);
@(CompiledLicenseFile)"
Outputs="@(DocFileItem);
@(IntermediateAssembly);
$(NonExistentFile)"
DependsOnTargets="$(CoreCompileDependsOn)"
>
<Booc
OutputAssembly="@(IntermediateAssembly)"
References="@(ReferencePath)"
Resources= "
@(ManifestResourceWithNoCulture);
@(ManifestNonResxWithNoCultureOnDisk);
@(CompiledLicenseFile)"
ResponseFiles="$(CompilerResponseFile)"
Sources="@(Compile)"
TargetType="$(OutputType)"
ToolPath="$(BoocToolPath)"
Pipelines="@(Pipeline)"
Verbosity="$(BoocVerbosity)"
Culture="$(AssemblyCulture)"
SourceDirectory="$(SourceDirectory)"
/>
</Target>
<Import Project="$(MSBuildBinPath)\Microsoft.Common.targets" />
</Project>

354
src/AddIns/BackendBindings/Boo/Boo.Microsoft.Build.Tasks/Booc.boo

@ -0,0 +1,354 @@ @@ -0,0 +1,354 @@
#region license
// Copyright (c) 2003, 2004, 2005 Rodrigo B. de Oliveira (rbo@acm.org)
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of Rodrigo B. de Oliveira nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
namespace Boo.Microsoft.Build.Tasks
import Microsoft.Build.Framework
import Microsoft.Build.Tasks
import Microsoft.Build.Utilities
import System
import System.Diagnostics
import System.IO
import System.Globalization
import System.Text.RegularExpressions
import System.Threading
class Booc(ManagedCompiler):
"""
Represents the Boo compiler MSBuild task.
Authors:
Sorin Ionescu (sorin.ionescu@gmail.com)
"""
Pipelines:
"""
Gets/sets the aditional pipelines to add to the compiler process.
"""
get:
return Bag['Pipelines'] as (string)
set:
Bag['Pipelines'] = value
Verbosity:
"""
Gets/sets the verbosity level.
"""
get:
return Bag['Verbosity'] as string
set:
Bag['Verbosity'] = value
Culture:
"""
Gets/sets the culture.
"""
get:
return Bag['Culture'] as string
set:
Bag['Culture'] = value
SourceDirectory:
"""
Gets/sets the source directory.
"""
get:
return Bag['Source Directory'] as string
set:
Bag['Source Directory'] = value
ToolName:
"""
Gets the tool name.
"""
get:
return "Booc.exe"
override def Execute():
"""
Executes the task.
Returns:
true if the task completed successfully; otherwise, false.
"""
boocCommandLine = CommandLineBuilderExtension()
AddResponseFileCommands(boocCommandLine)
warningPattern = regex(
'^(?<file>.*?)\\((?<line>\\d+),(?<column>\\d+)\\):' +
' (?<code>BCW\\d{4}): WARNING: (?<message>.*)$',
RegexOptions.Compiled)
# Captures the file, line, column, code, and message from a BOO warning
# in the form of: Program.boo(1,1): BCW0000: WARNING: This is a warning.
errorPattern = regex(
'^(((?<file>.*?)\\((?<line>\\d+),(?<column>\\d+)\\): )?' +
'(?<code>BCE\\d{4})|(?<errorType>Fatal) error):' +
'( Boo.Lang.Compiler.CompilerError:)?' +
' (?<message>.*?)($| --->)',
RegexOptions.Compiled |
RegexOptions.ExplicitCapture |
RegexOptions.Multiline)
/*
* Captures the file, line, column, code, error type, and message from a
* BOO error of the form of:
* 1. Program.boo(1,1): BCE0000: This is an error.
* 2. Program.boo(1,1): BCE0000: Boo.Lang.Compiler.CompilerError:
* This is an error. ---> Program.boo:4:19: This is an error
* 3. BCE0000: This is an error.
* 4. Fatal error: This is an error.
*
* The second line of the following error format is not cought because
* .NET does not support if|then|else in regular expressions,
* and the regex will be horrible complicated.
* The second line is as worthless as the first line.
* Therefore, it is not worth implementing it.
*
* Fatal error: This is an error.
* Parameter name: format.
*/
buildSuccess = true
outputLine = String.Empty
errorLine = String.Empty
readingDoneEvents = (ManualResetEvent(false), ManualResetEvent(false))
boocProcessStartInfo = ProcessStartInfo(
FileName: GenerateFullPathToTool(),
Arguments: boocCommandLine.ToString(),
ErrorDialog: false,
CreateNoWindow: true,
RedirectStandardError: true,
RedirectStandardInput: false,
RedirectStandardOutput: true,
UseShellExecute: false)
boocProcess = Process(StartInfo: boocProcessStartInfo)
parseOutput = def(line as string):
warningPatternMatch = warningPattern.Match(line)
errorPatternMatch = errorPattern.Match(line)
if warningPatternMatch.Success:
Log.LogWarning(
null,
warningPatternMatch.Groups['code'].Value,
null,
warningPatternMatch.Groups['file'].Value,
int.Parse(warningPatternMatch.Groups['line'].Value),
int.Parse(warningPatternMatch.Groups['column'].Value),
0,
0,
warningPatternMatch.Groups['message'].Value)
elif errorPatternMatch.Success:
code = errorPatternMatch.Groups['code'].Value
code = 'BCE0000' if string.IsNullOrEmpty(code)
file = errorPatternMatch.Groups['file'].Value
file = 'BOOC' if string.IsNullOrEmpty(file)
try:
lineNumber = int.Parse(
errorPatternMatch.Groups['line'].Value,
NumberStyles.Integer)
except FormatException:
lineNumber = 0
try:
columnNumber = int.Parse(
errorPatternMatch.Groups['column'].Value,
NumberStyles.Integer)
except FormatException:
columnNumber = 0
Log.LogError(
errorPatternMatch.Groups['errorType'].Value.ToLower(),
code,
null,
file,
lineNumber,
columnNumber,
0,
0,
errorPatternMatch.Groups['message'].Value)
buildSuccess = false
else:
Log.LogMessage(MessageImportance.Low, line)
readStandardOutput = def():
while true:
outputLine = boocProcess.StandardOutput.ReadLine()
if outputLine:
parseOutput(outputLine)
else:
readingDoneEvents[0].Set()
break
readStandardError = def():
while true:
errorLine = boocProcess.StandardError.ReadLine()
if errorLine:
parseOutput(errorLine)
else:
readingDoneEvents[1].Set()
break
standardOutputReadingThread = Thread(readStandardOutput as ThreadStart)
standardErrorReadingThread = Thread(readStandardError as ThreadStart)
# Two threads are required (MSDN); otherwise, a deadlock WILL occur.
try:
boocProcess.Start()
Log.LogMessage(
MessageImportance.High,
"${ToolName} ${boocProcess.StartInfo.Arguments}",
null)
standardOutputReadingThread.Start()
standardErrorReadingThread.Start()
WaitHandle.WaitAny((readingDoneEvents[0],))
WaitHandle.WaitAny((readingDoneEvents[1],))
# MSBuild runs on an STA thread, and WaitHandle.WaitAll()
# is not supported.
except e as Exception:
Log.LogErrorFromException(e)
buildSuccess = false
ensure:
boocProcess.Close()
return buildSuccess
protected override def AddCommandLineCommands(
commandLine as CommandLineBuilderExtension):
"""
Adds command line commands.
Remarks:
It prevents <ManagedCompiler> from adding the standard commands.
"""
pass
protected override def AddResponseFileCommands(
commandLine as CommandLineBuilderExtension):
"""
Generates the Boo compiler command line.
Returns:
The Boo compiler command line.
"""
commandLine.AppendSwitchIfNotNull('-t:', TargetType)
commandLine.AppendSwitchIfNotNull('-o:', OutputAssembly)
commandLine.AppendSwitchIfNotNull('-c:', Culture)
commandLine.AppendSwitchIfNotNull('-srcdir:', SourceDirectory)
if Pipelines:
for pipeline in Pipelines:
commandLine.AppendSwitchIfNotNull('-p:', pipeline)
if References:
for reference in References:
commandLine.AppendSwitchIfNotNull('-r:', reference)
if Resources:
for resource in Resources:
commandLine.AppendSwitchIfNotNull('-resource:', resource)
if Verbosity:
if string.Compare(
Verbosity,
'Normal',
StringComparison.InvariantCultureIgnoreCase) == 0:
pass
elif string.Compare(
Verbosity,
'Warning',
StringComparison.InvariantCultureIgnoreCase) == 0:
commandLine.AppendSwitch('-v')
elif string.Compare(
Verbosity,
'Info',
StringComparison.InvariantCultureIgnoreCase) == 0:
commandLine.AppendSwitch('-vv')
elif string.Compare(
Verbosity,
'Verbose',
StringComparison.InvariantCultureIgnoreCase) == 0:
commandLine.AppendSwitch('-vvv')
else:
Log.LogErrorWithCodeFromResources(
'Vbc.EnumParameterHasInvalidValue',
'Verbosity',
Verbosity,
'Normal, Warning, Info, Verbose')
commandLine.AppendFileNamesIfNotNull(Sources, ' ')
protected override def GenerateFullPathToTool():
"""
Generats the full path to booc.exe.
"""
toolPath as string = ToolPath
if toolPath is not null:
path = Path.Combine(toolPath, ToolName)
if path is null or not File.Exists(path):
path = Path.Combine(
Path.GetDirectoryName(typeof(Booc).Assembly.Location),
ToolName)
unless File.Exists(path):
path = ToolLocationHelper.GetPathToDotNetFrameworkFile(
ToolName,
TargetDotNetFrameworkVersion.Version20)
unless File.Exists(path):
Log.LogErrorWithCodeFromResources(
"General.FrameworksFileNotFound",
ToolName,
ToolLocationHelper.GetDotNetFrameworkVersionFolderPrefix(
TargetDotNetFrameworkVersion.Version20))
return path

42
src/AddIns/BackendBindings/Boo/Boo.Microsoft.Build.Tasks/CreateBooManifestResourceName.boo

@ -0,0 +1,42 @@ @@ -0,0 +1,42 @@
#region license
// Copyright (c) 2003, 2004, 2005 Rodrigo B. de Oliveira (rbo@acm.org)
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of Rodrigo B. de Oliveira nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
namespace Boo.Microsoft.Build.Tasks
import Microsoft.Build.Tasks
class CreateBooManifestResourceName(CreateCSharpManifestResourceName):
"""
Creates the manifest resource name.
Authors:
Sorin Ionescu (sorin.ionescu@gmail.com)
"""
def constructor():
super()

67
src/AddIns/BackendBindings/Boo/Boo.Microsoft.Build.Tasks/Project.booproj

@ -0,0 +1,67 @@ @@ -0,0 +1,67 @@
<Project
DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid></ProjectGuid>
<!-- OutputType: Exe|WinExe|Library -->
<OutputType>Exe</OutputType>
<AssemblyName>Company.Project</AssemblyName>
<RootNamespace>Company.Project</RootNamespace>
<!-- BoocVerbosity: Normal|Warning|Info|Verbose -->
<BoocVerbosity>Normal</BoocVerbosity>
<!-- Assembly culture. -->
<AssemblyCulture></AssemblyCulture>
<!-- Source directory. -->
<SourceDirectory></SourceDirectory>
<!--
Set this property if Boo is not installed in the
.NET Framework directory.
BoocToolPath: C:\Program Files\Boo\bin
-->
<BoocToolPath></BoocToolPath>
</PropertyGroup>
<!-- Only debug builds are currently supported. -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<OutputPath>bin\Debug\</OutputPath>
</PropertyGroup>
<!-- FOR FUTURE USE
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Relase\</OutputPath>
</PropertyGroup>
-->
<!-- Additional pipelines to use. -->
<ItemGroup>
<Pipeline Include="Pipeline.boo" />
</ItemGroup>
<!-- Assembly references. -->
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<!-- Files to compile. -->
<ItemGroup>
<Compile Include="Program.boo" />
</ItemGroup>
<!-- Resources to embed. -->
<ItemGroup>
<Resource Include="Resources.resx" />
</ItemGroup>
<Import Project="$(BoocToolPath)\Boo.Microsoft.Build.targets" Condition="$(BoocToolPath) != ''" />
<Import Project="$(MSBuildBinPath)\Boo.Microsoft.Build.targets" Condition="'$(BoocToolPath)' == ''"/>
</Project>

70
src/AddIns/BackendBindings/Boo/Boo.Microsoft.Build.Tasks/Properties/AssemblyInfo.boo

@ -0,0 +1,70 @@ @@ -0,0 +1,70 @@
#region license
// Copyright (c) 2003, 2004, 2005 Rodrigo B. de Oliveira (rbo@acm.org)
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of Rodrigo B. de Oliveira nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
namespace Boo.Microsoft.Build.Tasks.Properties
"""
Author:
Sorin Ionescu (sorin.ionescu@gmail.com)
"""
import System.Reflection
import System.Runtime.CompilerServices
import System.Runtime.InteropServices
# General Information about an assembly is controlled through the following
# set of attributes. Change these attribute values to modify the information
# associated with an assembly.
[assembly: AssemblyTitle('Boo.Microsoft.Build.Tasks')]
[assembly: AssemblyDescription('Contains Microsoft Build tasks for BOO code.')]
[assembly: AssemblyConfiguration('')]
[assembly: AssemblyCompany('')]
[assembly: AssemblyProduct('Boo.Microsoft.Build.Tasks')]
[assembly: AssemblyCopyright('Copyright (C) 2005')]
[assembly: AssemblyTrademark('')]
[assembly: AssemblyCulture('')]
# Setting ComVisible to false makes the types in this assembly not visible
# to COM componenets. If you need to access a type in this assembly from
# COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
# The following GUID is for the ID of the typelib if this project is exposed
# to COM.
# [assembly: Guid('')]
# Version information for an assembly consists of the following four values:
#
# Major Version
# Minor Version
# Build Number
# Revision
#
# You can specify all the values or you can default the Revision and
# Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion('1.0.0.0')]
[assembly: AssemblyFileVersion('1.0.0.0')]

6
src/AddIns/BackendBindings/Boo/BooBinding.sln

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# SharpDevelop 2.0.0.608
# SharpDevelop 2.0.0.618
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NRefactoryToBooConverter", "NRefactoryToBooConverter\Project\NRefactoryToBooConverter.csproj", "{DBCF20A1-BA13-4582-BFA9-74DE4D987B73}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NRefactoryToBooConverter.Tests", "NRefactoryToBooConverter\Test\NRefactoryToBooConverter.Tests.csproj", "{C9DE556D-325C-4544-B29F-16A9EB7C9830}"
@ -8,7 +8,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StandaloneConverter", "Stan @@ -8,7 +8,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StandaloneConverter", "Stan
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BooBinding", "BooBinding\Project\BooBinding.csproj", "{4AC2D5F1-F671-480C-A075-6BF62B3721B2}"
EndProject
Project("{A33008B1-5DAC-44D5-9060-242E3B6E38F2}") = "booish.gui", "booish.gui\booish.gui.booproj", "{928E34B2-5E46-4A4D-8E4D-2CA2CCDB905A}"
Project("{A33008B1-5DAC-44D5-9060-242E3B6E38F2}") = "Boo.Microsoft.Build.Tasks", "Boo.Microsoft.Build.Tasks\Boo.Microsoft.Build.Tasks.booproj", "{366B4AFE-C4E9-46DF-9CFF-57C62D414D4A}"
EndProject
Project("{A33008B1-5DAC-44D5-9060-242E3B6E38F2}") = "Boo.InterpreterAddIn", "Boo.InterpreterAddIn\Project\Boo.InterpreterAddIn.booproj", "{928E34B2-5E46-4A4D-8E4D-2CA2CCDB905A}"
EndProject
Global
EndGlobal

2
src/AddIns/BackendBindings/Boo/BooBinding/Project/PostBuildEvent.bat

@ -8,6 +8,6 @@ booc Boo.Microsoft.Build.Tasks.boo -t:library -o:Boo.Microsoft.Build.Tasks.dll - @@ -8,6 +8,6 @@ booc Boo.Microsoft.Build.Tasks.boo -t:library -o:Boo.Microsoft.Build.Tasks.dll -
popd
:copyFiles
copy "%1\..\..\RequiredLibraries\booc.*" .
copy "%1\..\..\RequiredLibraries\*.targets" .
copy "%1\..\..\Boo.Microsoft.Build.Tasks\*.targets" .
copy "%1\..\..\RequiredLibraries\Boo.Microsoft.Build.Tasks.dll" .
:BooPostBuildEventEnd

2
src/AddIns/DisplayBindings/ResourceEditor/Project/ResourceEditor.addin

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
languagePattern = "^ResourceFiles$"/>
</Path>
<Path name="/SharpDevelop/ResourceEdtior/ResourceList/ContextMenu">
<Path name="/SharpDevelop/ResourceEditor/ResourceList/ContextMenu">
<MenuItem id="AddStringEntry"
label="${res:ResourceEditor.ResourceEdit.ContextMenu.AddStringEntry}"
class="ResourceEditor.AddStringCommand"

2
src/AddIns/DisplayBindings/ResourceEditor/Project/Src/ResourceEdit/ResourceList.cs

@ -113,7 +113,7 @@ namespace ResourceEditor @@ -113,7 +113,7 @@ namespace ResourceEditor
AfterLabelEdit += new LabelEditEventHandler(afterLabelEdit);
ContextMenuStrip = MenuService.CreateContextMenu(editor, "/SharpDevelop/ResourceEdtior/ResourceList/ContextMenu");
ContextMenuStrip = MenuService.CreateContextMenu(editor, "/SharpDevelop/ResourceEditor/ResourceList/ContextMenu");
}
public void LoadFile(string filename)

32
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/DefaultFileNodeCommands.cs

@ -121,20 +121,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands @@ -121,20 +121,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
}
}
ItemType type;
if (fileNode.Project.CanCompile(fileNode.FileName)) {
type = ItemType.Compile;
} else {
switch (Path.GetExtension(fileNode.FileName).ToLower()) {
case ".resx":
case ".resources":
type = ItemType.EmbeddedResource;
break;
default:
type = ItemType.Content;
break;
}
}
ItemType type = GetDefaultItemType(fileNode.Project, fileNode.FileName);
FileProjectItem newItem = new FileProjectItem(fileNode.Project, type);
newItem.Include = FileUtility.GetRelativePath(fileNode.Project.Directory, fileNode.FileName);
@ -146,6 +133,22 @@ namespace ICSharpCode.SharpDevelop.Project.Commands @@ -146,6 +133,22 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
if (fileNode.Parent is ExtTreeNode) {
((ExtTreeNode)fileNode.Parent).UpdateVisibility();
}
fileNode.Project.Save();
}
public static ItemType GetDefaultItemType(IProject project, string fileName)
{
if (project.CanCompile(fileName)) {
return ItemType.Compile;
} else {
switch (Path.GetExtension(fileName).ToLowerInvariant()) {
case ".resx":
case ".resources":
return ItemType.EmbeddedResource;
default:
return ItemType.Content;
}
}
}
public static void IncludeDirectoryNode(DirectoryNode directoryNode, bool includeSubNodes)
@ -175,6 +178,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands @@ -175,6 +178,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
}
}
}
directoryNode.Project.Save();
}
public override void Run()

35
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/FolderNodeCommands.cs

@ -37,7 +37,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands @@ -37,7 +37,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
}
return 0;
}
public static void CopyDirectory(string directoryName, DirectoryNode node)
{
string copiedFileName = Path.Combine(node.Directory, Path.GetFileName(directoryName));
@ -108,14 +108,40 @@ namespace ICSharpCode.SharpDevelop.Project.Commands @@ -108,14 +108,40 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
fdiag.Filter = String.Join("|", fileFilters);
fdiag.Multiselect = true;
fdiag.CheckFileExists = true;
fdiag.Title = StringParser.Parse("${res:ProjectComponent.ContextMenu.AddExistingFiles}");
if (fdiag.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
string copiedFileName = Path.Combine(node.Directory, Path.GetFileName(fdiag.FileNames[0]));
if (!FileUtility.IsEqualFileName(fdiag.FileNames[0], copiedFileName)) {
int res = MessageService.ShowCustomDialog(fdiag.Title, "${res:ProjectComponent.ContextMenu.AddExistingFiles.Question}",
0, 2,
"${res:ProjectComponent.ContextMenu.AddExistingFiles.Copy}",
"${res:ProjectComponent.ContextMenu.AddExistingFiles.Link}",
"${res:Global.CancelButtonText}");
if (res == 1) {
foreach (string fileName in fdiag.FileNames) {
string relFileName = FileUtility.GetRelativePath(node.Project.Directory, fileName);
FileNode fileNode = new FileNode(relFileName, FileNodeStatus.InProject);
FileProjectItem fileProjectItem = new FileProjectItem(node.Project, IncludeFileInProject.GetDefaultItemType(node.Project, fileName));
fileProjectItem.Include = relFileName;
fileProjectItem.Properties.Set("Link", Path.GetFileName(fileName));
fileNode.ProjectItem = fileProjectItem;
fileNode.AddTo(node);
ProjectService.AddProjectItem(node.Project, fileProjectItem);
}
node.Project.Save();
return;
}
if (res == 2) {
return;
}
}
foreach (string fileName in fdiag.FileNames) {
CopyFile(fileName, node, true);
CopyFile(fileName, node, true);
}
node.Project.Save();
}
}
ProjectService.SaveSolution();
}
}
@ -153,8 +179,6 @@ namespace ICSharpCode.SharpDevelop.Project.Commands @@ -153,8 +179,6 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
}
}
}
ProjectService.SaveSolution();
}
}
@ -200,7 +224,6 @@ namespace ICSharpCode.SharpDevelop.Project.Commands @@ -200,7 +224,6 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
string newDirectoryName = GenerateValidDirectoryName(node.Directory);
DirectoryNode newDirectoryNode = CreateNewDirectory(node, newDirectoryName);
ProjectBrowserPad.Instance.StartLabelEdit(newDirectoryNode);
ProjectService.SaveSolution();
}
}
}

2
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/ReferenceFolderNodeCommands.cs

@ -35,7 +35,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands @@ -35,7 +35,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
foreach (ReferenceProjectItem reference in selDialog.ReferenceInformations) {
ProjectService.AddProjectItem(project, reference);
}
ProjectService.SaveSolution();
project.Save();
}
}
}

4
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/AbstractProjectBrowserTreeNode.cs

@ -16,11 +16,13 @@ using ICSharpCode.SharpDevelop.Gui; @@ -16,11 +16,13 @@ using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.SharpDevelop.Project
{
[Flags]
public enum FileNodeStatus {
None = 1,
InProject = 2,
Missing = 4,
BehindFile = 8
BehindFile = 8,
Link = 16,
}
public abstract class AbstractProjectBrowserTreeNode : ExtTreeNode, IDisposable

5
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/DirectoryNode.cs

@ -294,9 +294,10 @@ namespace ICSharpCode.SharpDevelop.Project @@ -294,9 +294,10 @@ namespace ICSharpCode.SharpDevelop.Project
if (cur.Value.ItemType == ItemType.Folder || cur.Value.ItemType == ItemType.WebReferences) {
new DirectoryNode(cur.Value.FileName.Trim('\\', '/'), FileNodeStatus.Missing).AddTo(this);
} else if (cur.Value is FileProjectItem) {
FileNode missingFile = new FileNode(cur.Value.FileName, FileNodeStatus.Missing);
FileProjectItem fileProjectItem = cur.Value as FileProjectItem;
FileNode missingFile = new FileNode(cur.Value.FileName, fileProjectItem.IsLink ? FileNodeStatus.InProject : FileNodeStatus.Missing);
missingFile.ProjectItem = cur.Value;
if (fileProjectItem != null && fileProjectItem.DependentUpon != null && fileProjectItem.DependentUpon.Length > 0) {
dependendFileDictionary[missingFile] = fileProjectItem.DependentUpon;
}

20
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/FileNode.cs

@ -41,8 +41,11 @@ namespace ICSharpCode.SharpDevelop.Project @@ -41,8 +41,11 @@ namespace ICSharpCode.SharpDevelop.Project
return projectItem;
}
set {
projectItem = value;
Tag = projectItem;
if (projectItem != value) {
projectItem = value;
Tag = projectItem;
SetIcon();
}
}
}
@ -70,7 +73,10 @@ namespace ICSharpCode.SharpDevelop.Project @@ -70,7 +73,10 @@ namespace ICSharpCode.SharpDevelop.Project
SetIcon("ProjectBrowser.GhostFile");
break;
case FileNodeStatus.InProject:
SetIcon(IconService.GetImageForFile(FileName));
if (projectItem is FileProjectItem && (projectItem as FileProjectItem).IsLink)
SetIcon("ProjectBrowser.CodeBehind");
else
SetIcon(IconService.GetImageForFile(FileName));
break;
case FileNodeStatus.Missing:
SetIcon("ProjectBrowser.MissingFile");
@ -98,7 +104,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -98,7 +104,7 @@ namespace ICSharpCode.SharpDevelop.Project
ToolbarAddinTreePath = "/SharpDevelop/Pads/ProjectBrowser/ToolBar/File";
this.fileNodeStatus = fileNodeStatus;
this.FileName = fileName;
autoClearNodes = false;
SetIcon();
}
@ -138,7 +144,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -138,7 +144,7 @@ namespace ICSharpCode.SharpDevelop.Project
{
return visitor.Visit(this, data);
}
#region Drag & Drop
public override DataObject DragDropDataObject {
get {
@ -163,7 +169,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -163,7 +169,7 @@ namespace ICSharpCode.SharpDevelop.Project
return true;
}
}
public override void Delete()
{
if (FileNodeStatus == FileNodeStatus.Missing) {
@ -200,7 +206,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -200,7 +206,7 @@ namespace ICSharpCode.SharpDevelop.Project
ClipboardWrapper.SetDataObject(new DataObject(typeof(FileNode).ToString(), new FileOperationClipboardObject(FileName, true)));
}
public override bool EnablePaste {
get {
return ((ExtTreeNode)Parent).EnablePaste;

7
src/Main/Base/Project/Src/Project/Items/FileProjectItem.cs

@ -91,6 +91,13 @@ namespace ICSharpCode.SharpDevelop.Project @@ -91,6 +91,13 @@ namespace ICSharpCode.SharpDevelop.Project
}
}
[Browsable(false)]
public bool IsLink {
get {
return base.Properties.IsSet("Link");
}
}
public FileProjectItem(IProject project, ItemType type) : base(project)
{
this.type = type;

2
src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs

@ -166,6 +166,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -166,6 +166,7 @@ namespace ICSharpCode.SharpDevelop.Project
/// <summary>
/// Adds a project item to the project, raising the ProjectItemAdded event.
/// Make sure you call project.Save() after adding new items!
/// </summary>
public static void AddProjectItem(IProject project, ProjectItem item)
{
@ -177,6 +178,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -177,6 +178,7 @@ namespace ICSharpCode.SharpDevelop.Project
/// <summary>
/// Removes a project item from the project, raising the ProjectItemRemoved event.
/// Make sure you call project.Save() after removing items!
/// </summary>
public static void RemoveProjectItem(IProject project, ProjectItem item)
{

10
src/Main/Base/Project/Src/TextEditor/Commands/ClassBookmarkMenuBuilder.cs

@ -84,8 +84,10 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands @@ -84,8 +84,10 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands
subItems.Add(new MenuCommand(interf.Name, eh));
}
}
list.Add(new ICSharpCode.Core.Menu("${res:SharpDevelop.Refactoring.ImplementInterfaceImplicit}", subItems.ToArray()));
subItems = new List<ToolStripItem>();
if (subItems.Count > 0) {
list.Add(new ICSharpCode.Core.Menu("${res:SharpDevelop.Refactoring.ImplementInterfaceImplicit}", subItems.ToArray()));
subItems = new List<ToolStripItem>();
}
foreach (IReturnType rt in c.BaseTypes) {
IClass interf = rt.GetUnderlyingClass();
if (interf != null && interf.ClassType == ClassType.Interface) {
@ -97,7 +99,9 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands @@ -97,7 +99,9 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands
subItems.Add(new MenuCommand(interf.Name, eh));
}
}
list.Add(new ICSharpCode.Core.Menu("${res:SharpDevelop.Refactoring.ImplementInterfaceExplicit}", subItems.ToArray()));
if (subItems.Count > 0) {
list.Add(new ICSharpCode.Core.Menu("${res:SharpDevelop.Refactoring.ImplementInterfaceExplicit}", subItems.ToArray()));
}
}
static IDocument GetDocument(IClass c)

BIN
src/Main/StartUp/Project/Resources/StringResources.resources

Binary file not shown.
Loading…
Cancel
Save