Skip to content

Commit

Permalink
WinLess 1.6.0:
Browse files Browse the repository at this point in the history
Changed WinLess to do the compiling via less.js via Node
  • Loading branch information
marklagendijk committed Nov 26, 2012
1 parent 1227b4f commit ed5d99b
Show file tree
Hide file tree
Showing 158 changed files with 12,684 additions and 651 deletions.
8 changes: 4 additions & 4 deletions Installer/WinLess.warsetup
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<WarSetup-Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" projectRunAfterInstall="true" mainTargetApp="ID_bcbdd185_a875_4976_b079_d9cf83e2ad0e" nextUniqueId="1479" projectName="WinLess" projectUuid="aca1172c-5ac1-45cc-94f9-fb1f3f0eb2be" projectUpgradeUuid="b795642a-13ec-4b7c-bb13-d8f0311fc42d" projectVersion="1.5.4" projectOrganization="Mark Lagendijk" projectMustBeAdministratorToInstall="false" project64BitTarget="false" projectTargetDirectory="C:\projects\WinLess\installer" projectTargetName="WinLess-1.5.4" projectType="0" projectUserInterface="WixUI_Minimal">
<WarSetup-Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" projectRunAfterInstall="true" mainTargetApp="ID_bcbdd185_a875_4976_b079_d9cf83e2ad0e" nextUniqueId="1502" projectName="WinLess" projectUuid="eb24e9df-ad8c-4522-977d-776c254f3ab2" projectUpgradeUuid="b795642a-13ec-4b7c-bb13-d8f0311fc42d" projectVersion="1.6.0" projectOrganization="Mark Lagendijk" projectMustBeAdministratorToInstall="false" project64BitTarget="false" projectTargetDirectory="C:\projects\WinLess\installer" projectTargetName="WinLess-1.6.0" projectType="0" projectUserInterface="WixUI_Minimal">
<LicencePaths>
<string>C:\Program Files (x86)\Jgaa's Internet\War Setup\Licenses</string>
</LicencePaths>
<Virgin>false</Virgin>
<projectFeatures featureId="ID4B71809E576219FB04EFDAC6A25F9E27" featureName="WinLess" featureDescription="The complete package" configurableDirectory="APPLICATIONFOLDER" configurableDirectoryDefaultPath="[ProjectName]" enableInDefaultInstall="true" enableInMinimalInstall="true" excludeFromBuild="false">
<childFeatures featureId="PROGRAM" featureName="WinLess" featureDescription="WinLess" enableInDefaultInstall="true" enableInMinimalInstall="true" excludeFromBuild="false">
<components componentId="ID1003" componentGuid="7c4a8889-88bd-4c03-a37e-425202af09a9">
<componentFiles fileId="ID_bcbdd185_a875_4976_b079_d9cf83e2ad0e" srcName="winless.exe" srcDirectory="C:\projects\WinLess\WinLess\bin\Release" dstName="WinLess.exe" dstPath="" isTrueTypeFont="false" isComModule="false" typelibGuid="" menuName="WinLess" shortcutInProgramFilesMenu="true" shortcutOnDesktop="false" shortcutInQuickLaunch="false" shortcutInStartupFolder="false" shortcutWorkingDirectory="" shortcutCommandArguments="" shortcutDescription="">
<componentFiles fileId="ID_bcbdd185_a875_4976_b079_d9cf83e2ad0e" srcName="winless.exe" srcDirectory="..\WinLess\bin\Release" dstName="WinLess.exe" dstPath="" isTrueTypeFont="false" isComModule="false" typelibGuid="" menuName="WinLess" shortcutInProgramFilesMenu="true" shortcutOnDesktop="false" shortcutInQuickLaunch="false" shortcutInStartupFolder="false" shortcutWorkingDirectory="" shortcutCommandArguments="" shortcutDescription="">
<service StartWhenInstalled="true" Remove="both" id="ID1002" isService="false" userAccount="" userPassword="" cmdLineArguments="" errorControl="normal" interactive="false" loadOrderGroup="" serviceName="" startMode="auto" vital="true" />
</componentFiles>
<addToCreateFolder>false</addToCreateFolder>
Expand All @@ -19,8 +19,8 @@
<addToCreateFolder>false</addToCreateFolder>
</components>
<defaultInstallMode>3</defaultInstallMode>
<directories dirId="ID1356" srcPath="..\WinLess\bin\Release\Less" dstPath="Less" patterns=".*" excludePatterns="" recurse="false" preventEmptyDirectories="false" addToPath="false" ideHeaderFiles="false" ideExecutables="false" ideLibrary="false" ideMicrosoftVisualStudio2003="false" ideMicrosoftVisualStudio2005="false">
<pathComponent componentId="ID1355" componentGuid="ddc50de7-d493-47a5-b451-07d7ff8476b9">
<directories dirId="ID1480" srcPath="..\WinLess\bin\Release\node_modules" dstPath="node_modules" patterns=".*" excludePatterns="" recurse="true" preventEmptyDirectories="false" addToPath="false" ideHeaderFiles="false" ideExecutables="false" ideLibrary="false" ideMicrosoftVisualStudio2003="false" ideMicrosoftVisualStudio2005="false">
<pathComponent componentId="ID1479" componentGuid="63432b1f-70e0-444c-86a8-8b4220f89730">
<addToCreateFolder>false</addToCreateFolder>
</pathComponent>
</directories>
Expand Down
31 changes: 1 addition & 30 deletions WinLess/Forms/aboutForm.cs
Expand Up @@ -17,7 +17,7 @@ public aboutForm()
{
InitializeComponent();
winlessVersionLabel.Text = GetApplicationVersion();
lessjsVersionLabel.Text = GetLessJsVersion();
lessjsVersionLabel.Text = LessCompiler.GetVersion();
}

private string GetApplicationVersion()
Expand All @@ -27,34 +27,5 @@ private string GetApplicationVersion()
// return the ProductVersion without the last '.0'
return version.Substring(0, version.Length - 2);
}

private string GetLessJsVersion()
{
string lessFileName = string.Format("{0}\\Less\\less.js", Application.StartupPath);

// read the less.js file
string lessFileText = null;
try
{
StreamReader streamReader = new StreamReader(lessFileName);
lessFileText = streamReader.ReadToEnd();
streamReader.Close();
}
catch (Exception e)
{
ExceptionHandler.LogException(e);
}

// retreive the version number from the text of less.js
if (!string.IsNullOrEmpty(lessFileText))
{
Match versionMatch = Regex.Match(lessFileText, "// LESS - Leaner CSS v(.+)");
if(versionMatch.Groups.Count > 1){
return versionMatch.Groups[1].Value;
}
}

return "Error while reading version number.";
}
}
}
2 changes: 1 addition & 1 deletion WinLess/Forms/mainForm.Designer.cs

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

29 changes: 16 additions & 13 deletions WinLess/Forms/mainForm.cs
Expand Up @@ -9,7 +9,6 @@
using System.Diagnostics;
using WinLess.Models;
using WinLess.Helpers;
using WinLess.Less;

namespace WinLess
{
Expand All @@ -24,7 +23,7 @@ public static mainForm ActiveOrInActiveMainForm
}
}

private delegate void AddCompileResultDelegate(Models.CompileResult result);
private delegate void AddCompileResultDelegate(Models.CompileCommandResult result);
private bool finishedLoading;

#region mainForm init and shutdown
Expand All @@ -42,15 +41,15 @@ public mainForm()
InitializeComponent();
initFilesDataGridViewCheckAllCheckBox();
foldersListBox.DataSource = Program.Settings.DirectoryList.Directories;
compileResultsDataGridView.DataSource = new List<Models.CompileResult>();
compileResultsDataGridView.DataSource = new List<Models.CompileCommandResult>();
}
catch (Exception e)
{
ExceptionHandler.LogException(e);
}
}

public void LoadDirectories(CommandLineArguments args)
public void LoadDirectories(CommandArguments args)
{
if (args.ClearDirectories)
{
Expand Down Expand Up @@ -95,7 +94,7 @@ private void mainForm_Activated(object sender, EventArgs e)
private void mainForm_Load(object sender, EventArgs e)
{
string[] args = Environment.GetCommandLineArgs();
CommandLineArguments commandLineArgs = new CommandLineArguments(args);
CommandArguments commandLineArgs = new CommandArguments(args);
if (commandLineArgs.HasArguments)
{
LoadDirectories(commandLineArgs);
Expand Down Expand Up @@ -357,25 +356,29 @@ private void compileToolStripMenuItem_Click(object sender, EventArgs e)

#region compileResultsDataGridView

public void AddCompileResult(Models.CompileResult result)
public void AddCompileResult(Models.CompileCommandResult result)
{
if (InvokeRequired)
{
this.Invoke(new AddCompileResultDelegate(AddCompileResult), new object[] { result });
return;
}

List<Models.CompileResult> compileResults = (List<Models.CompileResult>)compileResultsDataGridView.DataSource;
if (result.IsSuccess){
result.ResultText = "success";
}

List<Models.CompileCommandResult> compileResults = (List<Models.CompileCommandResult>)compileResultsDataGridView.DataSource;
compileResults.Insert(0, result);
compileResultsDataGridView_DataChanged();

if (string.Compare(result.ResultText, "success", StringComparison.InvariantCultureIgnoreCase) != 0)
if (result.IsSuccess && Program.Settings.ShowSuccessMessages)
{
ShowErrorNotification("Compile error", result.ResultText);
ShowSuccessNotification("Successful compile", result.ResultText);
}
else if (Program.Settings.ShowSuccessMessages)
else if(!result.IsSuccess)
{
ShowSuccessNotification("Successful compile", result.FullPath);
ShowErrorNotification("Compile error", result.ResultText);
}
}

Expand All @@ -390,7 +393,7 @@ private void compileResultsDataGridView_DataChanged()

private void clearCompileResultsButton_Click(object sender, EventArgs e)
{
compileResultsDataGridView.DataSource = new List<Models.CompileResult>();
compileResultsDataGridView.DataSource = new List<Models.CompileCommandResult>();
compileResultsDataGridView_DataChanged();
}

Expand Down Expand Up @@ -492,7 +495,7 @@ private void CompileSelectedFiles()
{
if (file.Enabled)
{
Compiler.CompileLessFile(file.FullPath, file.OutputPath, file.Minify);
LessCompiler.CompileLessFile(file.FullPath, file.OutputPath, file.Minify);
}
}
}
Expand Down
92 changes: 0 additions & 92 deletions WinLess/Less/Compiler.cs

This file was deleted.

9 changes: 0 additions & 9 deletions WinLess/Less/less.js

This file was deleted.

2 changes: 0 additions & 2 deletions WinLess/Less/lessc.cmd

This file was deleted.

0 comments on commit ed5d99b

Please sign in to comment.