Skip to content

Commit

Permalink
[VS2010] [VS2008] New Nemerle binaries path calculation algorithm. Cl…
Browse files Browse the repository at this point in the history
…oses #118.
  • Loading branch information
VladD2 committed Oct 11, 2011
1 parent 7385ab2 commit 45daa34
Show file tree
Hide file tree
Showing 23 changed files with 1,343 additions and 662 deletions.
4 changes: 2 additions & 2 deletions NemerleAll.nproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(NInstall)' == '' ">
<!--Folder for Nemerle installation. To install use "Install" terget.-->
<NInstall Condition="'$(TargetFrameworkVersion)' != 'v4.0'">$(ProgramFiles)\Nemerle</NInstall>
<NInstall Condition="'$(TargetFrameworkVersion)' != 'v4.0'">$(ProgramFiles)\Nemerle\Net-3.5</NInstall>
<NInstall Condition="'$(TargetFrameworkVersion)' == 'v4.0'">$(ProgramFiles)\Nemerle\Net-4.0</NInstall>
</PropertyGroup>
<PropertyGroup>
Expand Down Expand Up @@ -133,7 +133,7 @@
</PropertyGroup>
<Message Text="Framework tools found at:" Importance="high" />
<Message Text=" MSBuild - $(MSBuild)" Importance="high" />
<Message Text=" NGen - $(NGen)" Importance="high" />
<Message Text=" NGen - $(NGen)" Importance="high" />
<Message Text=" SDK tools found at:" Importance="high" />
<Message Text=" GacUtil - $(GacUtil)" Importance="high" />
<Message Text=" Ildasm - $(Ildasm)" Importance="high" />
Expand Down
4 changes: 2 additions & 2 deletions Reg-bins-2.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set NemerleRoot=%~dp0.
set GacUtil="%VS90COMNTOOLS%..\..\SDK\v2.0\Bin\gacutil.exe"
set NemerleInstall=%ProgramFiles%\Nemerle
set NemerleInstall=%ProgramFiles%\Nemerle\Net-3.5

IF NOT "%PROCESSOR_ARCHITECTURE%" == "x86" goto b64
IF NOT "%PROCESSOR_ARCHITEW6432%" == "" goto b64
Expand Down Expand Up @@ -49,7 +49,7 @@ md "%NemerleInstall%"

set NemerleMSBuildTargets=%NemerleInstall%\Nemerle.MSBuild.targets

@echo Add NemerleTarget=%NemerleMSBuildTargets%
@echo Add NemerleTarget=%NemerleMSBuildTargets%
@echo into HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\MSBuild\SafeImports
reg.exe add HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\MSBuild\SafeImports /v NemerleTarget /d "%NemerleInstall%\Nemerle.MSBuild.targets" /f

Expand Down
4 changes: 2 additions & 2 deletions Reg-bins.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ IF "%Type%"=="" set Type=Debug
set NemerleBin=%~dp0bin\%Type%
set NemerleRoot=%~dp0.
set GacUtil="%VS90COMNTOOLS%..\..\SDK\v2.0\Bin\gacutil.exe"
set NemerleInstall=%ProgramFiles%\Nemerle
set NemerleInstall=%ProgramFiles%\Nemerle\Net-3.5

IF NOT "%PROCESSOR_ARCHITECTURE%" == "x86" goto b64
IF NOT "%PROCESSOR_ARCHITEW6432%" == "" goto b64
Expand Down Expand Up @@ -74,7 +74,7 @@ copy /Y "%NemerleBin%\*.xml" "%NemerleInstall%\*.xml"

set NemerleMSBuildTargets=%NemerleInstall%\Nemerle.MSBuild.targets

@echo Add NemerleTarget=%NemerleMSBuildTargets%
@echo Add NemerleTarget=%NemerleMSBuildTargets%
@echo into HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\MSBuild\SafeImports
reg.exe add HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\MSBuild\SafeImports /v NemerleTarget /d "%NemerleInstall%\Nemerle.MSBuild.targets" /f

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<NoStdLib>true</NoStdLib>
<Nemerle Condition=" ('$(Nemerle)' == '') And Exists('$(ProgramFiles)\Nemerle') ">$(ProgramFiles)\Nemerle</Nemerle>
<Nemerle Condition=" ('$(Nemerle)' == '') And Exists('$(ProgramW6432)\Nemerle') ">$(ProgramW6432)\Nemerle</Nemerle>
<NemerleVersion>Net-3.5</NemerleVersion>
<NemerleBinPathRoot Condition=" ('$(NemerleBinPathRoot)' == '') And Exists('$(ProgramFiles)\Nemerle') ">$(ProgramFiles)\Nemerle</NemerleBinPathRoot>
<NemerleBinPathRoot Condition=" ('$(NemerleBinPathRoot)' == '') And Exists('$(ProgramW6432)\Nemerle') ">$(ProgramW6432)\Nemerle</NemerleBinPathRoot>
<Nemerle Condition=" '$(Nemerle)' == '' ">$(NemerleBinPathRoot)\$(NemerleVersion)</Nemerle>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\Nemerle.VisualStudio\nemerle.snk</AssemblyOriginatorKeyFile>
<FileUpgradeFlags>
Expand Down Expand Up @@ -98,7 +100,7 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(Nemerle)\Nemerle.MSBuild.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target> -->
Expand All @@ -112,4 +114,4 @@
<PropertyGroup Condition=" '$(UserDefinedConstants)' != '' ">
<DefineConstants>$(DefineConstants);$(UserDefinedConstants)</DefineConstants>
</PropertyGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<NoStdLib>true</NoStdLib>
<Nemerle Condition=" ('$(Nemerle)' == '') And Exists('$(ProgramFiles)\Nemerle') ">$(ProgramFiles)\Nemerle</Nemerle>
<Nemerle Condition=" ('$(Nemerle)' == '') And Exists('$(ProgramW6432)\Nemerle') ">$(ProgramW6432)\Nemerle</Nemerle>
<NemerleVersion>Net-3.5</NemerleVersion>
<NemerleBinPathRoot Condition=" ('$(NemerleBinPathRoot)' == '') And Exists('$(ProgramFiles)\Nemerle') ">$(ProgramFiles)\Nemerle</NemerleBinPathRoot>
<NemerleBinPathRoot Condition=" ('$(NemerleBinPathRoot)' == '') And Exists('$(ProgramW6432)\Nemerle') ">$(ProgramW6432)\Nemerle</NemerleBinPathRoot>
<Nemerle Condition=" '$(Nemerle)' == '' ">$(NemerleBinPathRoot)\$(NemerleVersion)</Nemerle>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\Nemerle.VisualStudio\nemerle.snk</AssemblyOriginatorKeyFile>
<FileUpgradeFlags>
Expand Down Expand Up @@ -300,7 +302,7 @@
</Compile>
</ItemGroup>
<Import Project="$(Nemerle)\Nemerle.MSBuild.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
Expand All @@ -311,4 +313,4 @@
<PropertyGroup Condition=" '$(UserDefinedConstants)' != '' ">
<DefineConstants>$(DefineConstants);$(UserDefinedConstants)</DefineConstants>
</PropertyGroup>
</Project>
</Project>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 74 additions & 0 deletions VsIntegration/Nemerle.VisualStudio/GUI/PromptProjectRenameForm.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace Nemerle.VisualStudio.GUI
{
public partial class PromptProjectRenameForm : Form
{
public PromptProjectRenameForm(string projectName)
{
InitializeComponent();
ProjectName = projectName;
_newProjectName.Text = projectName + "-VS_2008";
}

public string ProjectName { get; private set; }

private void PromptProjectRenameForm_FormClosing(object _, FormClosingEventArgs e)
{
}

bool ValidateData()
{
var newName = _newProjectName.Text;
var isError = string.Equals(ProjectName, newName, StringComparison.InvariantCultureIgnoreCase);

if (isError)
{
_errorProvider.SetError(_newProjectName, "The new project name must differ from the old name.");
_yesButton.Enabled = false;
return false;
}

var isInvalidName = newName.Any(c => Path.GetInvalidFileNameChars().Contains(c));

if (isInvalidName)
{
_errorProvider.SetError(_newProjectName, "The new project name contains invalid characters.");
_yesButton.Enabled = false;
return false;
}

_errorProvider.SetError(_newProjectName, "");
_yesButton.Enabled = true;
return true;
}

private void _newProjectName_Validating(object _, CancelEventArgs e)
{
_yesButton.Enabled = ValidateData();
}

private void _yesButton_Click(object sender, EventArgs e)
{
if (ValidateData())
{
Close();
DialogResult = System.Windows.Forms.DialogResult.Yes;
ProjectName = _newProjectName.Text;
}
}

private void _newProjectName_TextChanged(object sender, EventArgs e)
{
_yesButton.Enabled = ValidateData();
}
}
}
Loading

0 comments on commit 45daa34

Please sign in to comment.