Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 24 additions & 10 deletions Build/Manage-LocalLibraries.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

.PARAMETER Library
Which library to set a version for (SetVersion mode only):
liblcm, libpalaso, chorus, machine, or l10nsharp.
lcm, palaso, chorus, machine, or l10nsharp.

.PARAMETER Version
Sets the version in SilVersions.props (SetVersion mode). Use to revert
Expand All @@ -75,7 +75,7 @@
Packs libpalaso (from env var) and then chorus from the given path.

.EXAMPLE
.\Build\Manage-LocalLibraries.ps1 -Library libpalaso -Version 17.0.0
.\Build\Manage-LocalLibraries.ps1 -Library palaso -Version 17.0.0
Sets libpalaso version to 17.0.0 in SilVersions.props (e.g. to revert).
#>
[CmdletBinding()]
Expand All @@ -95,7 +95,7 @@ param(
[switch]$L10nSharp,
[string]$L10nSharpPath,

[ValidateSet('liblcm', 'libpalaso', 'chorus', 'machine', 'l10nsharp')]
[ValidateSet('palaso', 'lcm', 'chorus', 'machine', 'l10nsharp')]
[string]$Library,

[string]$Version
Expand All @@ -108,7 +108,7 @@ $ErrorActionPreference = "Stop"
# ---------------------------------------------------------------------------

$LibraryConfig = @{
libpalaso = @{
palaso = @{
VersionProperty = 'SilLibPalasoVersion'
PdbRelativeDir = 'output/Debug/net462'
CachePrefixes = @(
Expand All @@ -118,7 +118,7 @@ $LibraryConfig = @{
)
EnvVar = 'LIBPALASO_PATH'
}
liblcm = @{
lcm = @{
VersionProperty = 'SilLcmVersion'
PdbRelativeDir = 'artifacts/Debug/net462'
CachePrefixes = @('sil.lcmodel')
Expand Down Expand Up @@ -150,7 +150,7 @@ $LibraryConfig = @{
}

# Pack order: libpalaso first (other libraries may depend on it)
$PackOrder = @('libpalaso', 'l10nsharp', 'liblcm', 'chorus', 'machine')
$PackOrder = @('palaso', 'l10nsharp', 'lcm', 'chorus', 'machine')

# ---------------------------------------------------------------------------
# Read SilVersions.props
Expand Down Expand Up @@ -188,7 +188,21 @@ function Update-VersionAndClearCache {
$cfg = $LibraryConfig[$LibName]
$node = Get-VersionNode $LibName
$node.InnerText = $NewVersion
$versionProps.Save($versionPropsPath)

# Save with XmlWriter to preserve tab indentation (XmlDocument.Save() converts tabs to spaces)
$writerSettings = New-Object System.Xml.XmlWriterSettings
$writerSettings.Indent = $true
$writerSettings.IndentChars = "`t"
$writerSettings.NewLineChars = "`r`n"
$writerSettings.Encoding = New-Object System.Text.UTF8Encoding($false) # UTF-8 without BOM
$writerSettings.OmitXmlDeclaration = -not $versionProps.FirstChild.NodeType.Equals([System.Xml.XmlNodeType]::XmlDeclaration)
$writer = [System.Xml.XmlWriter]::Create($versionPropsPath, $writerSettings)
try {
$versionProps.WriteTo($writer)
} finally {
$writer.Close()
}

Write-Host "Updated SilVersions.props ($($cfg.VersionProperty) = $NewVersion)" -ForegroundColor Yellow

$packagesDir = Join-Path $repoRoot "packages"
Expand Down Expand Up @@ -345,8 +359,8 @@ function Invoke-PackLibrary {

# Map switches and explicit paths to library names
$switchMap = @{
libpalaso = @{ Enabled = [bool]$Palaso; ExplicitPath = $PalasoPath }
liblcm = @{ Enabled = [bool]$Lcm; ExplicitPath = $LcmPath }
palaso = @{ Enabled = [bool]$Palaso; ExplicitPath = $PalasoPath }
lcm = @{ Enabled = [bool]$Lcm; ExplicitPath = $LcmPath }
chorus = @{ Enabled = [bool]$Chorus; ExplicitPath = $ChorusPath }
machine = @{ Enabled = [bool]$Machine; ExplicitPath = $MachinePath }
l10nsharp = @{ Enabled = [bool]$L10nSharp; ExplicitPath = $L10nSharpPath }
Expand Down Expand Up @@ -436,5 +450,5 @@ elseif ($Library -and $Version) {
Write-Host "Run .\build.ps1 to restore and build with the new version." -ForegroundColor Cyan
}
else {
throw "Nothing to do. Use -Palaso/-Lcm/-Chorus/-Machine/-L10nSharp switches to pack, or -Library and -Version to set a version.`nExamples:`n .\Build\Manage-LocalLibraries.ps1 -Palaso -PalasoPath C:\Repos\libpalaso`n .\Build\Manage-LocalLibraries.ps1 -Palaso -Chorus`n .\Build\Manage-LocalLibraries.ps1 -Machine -MachinePath C:\Repos\machine`n .\Build\Manage-LocalLibraries.ps1 -Library l10nsharp -Version 10.0.0`n .\Build\Manage-LocalLibraries.ps1 -Library libpalaso -Version 17.0.0"
throw "Nothing to do. Use -Palaso/-Lcm/-Chorus/-Machine/-L10nSharp switches to pack, or -Library and -Version to set a version.`nExamples:`n .\Build\Manage-LocalLibraries.ps1 -Palaso -PalasoPath C:\Repos\libpalaso`n .\Build\Manage-LocalLibraries.ps1 -Palaso -Chorus`n .\Build\Manage-LocalLibraries.ps1 -Machine -MachinePath C:\Repos\machine`n .\Build\Manage-LocalLibraries.ps1 -Library l10nsharp -Version 10.0.0`n .\Build\Manage-LocalLibraries.ps1 -Library palaso -Version 17.0.0"
}
4 changes: 2 additions & 2 deletions Build/SilVersions.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<!--
<!--
=============================================================
SIL ECOSYSTEM VERSION PROPERTIES
Single source of truth for all SIL dependency versions.
Expand All @@ -12,7 +12,7 @@
=============================================================
-->
<PropertyGroup Label="SIL Ecosystem Versions">
<SilLcmVersion>11.0.0-beta0161</SilLcmVersion>
<SilLcmVersion>11.0.0-beta0166</SilLcmVersion>
<SilLibPalasoVersion>18.0.0-beta0013</SilLibPalasoVersion>
<SilLibPalasoL10nsVersion>18.0.0-beta0012</SilLibPalasoL10nsVersion>
<SilChorusVersion>6.0.0-beta0065</SilChorusVersion>
Expand Down
10 changes: 10 additions & 0 deletions Src/FwCoreDlgs/BackupRestore/BackupProjectDlg.Designer.cs

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

18 changes: 18 additions & 0 deletions Src/FwCoreDlgs/BackupRestore/BackupProjectDlg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ public BackupProjectDlg(LcmCache cache,
m_supportingFiles.Enabled = false;
}

if (m_presenter.SendReceiveDataExists)
{
m_sendReceiveData.Checked = true;
}
else
{
m_sendReceiveData.Enabled = false;
}

DestinationFolder = FwDirectoryFinder.DefaultBackupDirectory;
if (File.Exists(m_presenter.PersistanceFilePath))
{
Expand Down Expand Up @@ -240,6 +249,15 @@ public bool IncludeSpellCheckAdditions
set { m_spellCheckAdditions.Checked = value; }
}

///<summary>
/// Whether or not user wants Send/Receive repository data in the backup.
///</summary>
public bool IncludeSendReceiveData
{
get { return m_sendReceiveData.Checked; }
set { m_sendReceiveData.Checked = value; }
}

/// <summary>
/// Read/Write the comment from/to the dialog text control.
/// </summary>
Expand Down
47 changes: 37 additions & 10 deletions Src/FwCoreDlgs/BackupRestore/BackupProjectDlg.resx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,33 @@
<value>groupBox1</value>
</data>
<data name="&gt;&gt;m_spellCheckAdditions.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="m_sendReceiveData.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="m_sendReceiveData.Location" type="System.Drawing.Point, System.Drawing">
<value>15, 113</value>
</data>
<data name="m_sendReceiveData.Size" type="System.Drawing.Size, System.Drawing">
<value>200, 17</value>
</data>
<data name="m_sendReceiveData.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="m_sendReceiveData.Text" xml:space="preserve">
<value>Send/Receive data (repository history)</value>
</data>
<data name="&gt;&gt;m_sendReceiveData.Name" xml:space="preserve">
<value>m_sendReceiveData</value>
</data>
<data name="&gt;&gt;m_sendReceiveData.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;m_sendReceiveData.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;m_sendReceiveData.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="m_supportingFiles.AutoSize" type="System.Boolean, mscorlib">
Expand Down Expand Up @@ -241,7 +268,7 @@
<value>12, 12</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>555, 148</value>
<value>555, 171</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
Expand All @@ -265,7 +292,7 @@
<value>True</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>9, 174</value>
<value>9, 197</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>54, 13</value>
Expand All @@ -289,7 +316,7 @@
<value>7</value>
</data>
<data name="m_comment.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 194</value>
<value>12, 217</value>
</data>
<data name="m_comment.Size" type="System.Drawing.Size, System.Drawing">
<value>555, 20</value>
Expand All @@ -313,7 +340,7 @@
<value>True</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 229</value>
<value>12, 252</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>46, 13</value>
Expand All @@ -337,7 +364,7 @@
<value>5</value>
</data>
<data name="m_destinationFolder.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 251</value>
<value>12, 274</value>
</data>
<data name="m_destinationFolder.Size" type="System.Drawing.Size, System.Drawing">
<value>476, 20</value>
Expand All @@ -358,7 +385,7 @@
<value>4</value>
</data>
<data name="m_browse.Location" type="System.Drawing.Point, System.Drawing">
<value>494, 248</value>
<value>494, 271</value>
</data>
<data name="m_browse.Size" type="System.Drawing.Size, System.Drawing">
<value>73, 23</value>
Expand All @@ -385,7 +412,7 @@
<value>Bottom, Right</value>
</data>
<data name="m_backUp.Location" type="System.Drawing.Point, System.Drawing">
<value>328, 290</value>
<value>328, 313</value>
</data>
<data name="m_backUp.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
Expand All @@ -412,7 +439,7 @@
<value>Bottom, Right</value>
</data>
<data name="m_cancel.Location" type="System.Drawing.Point, System.Drawing">
<value>409, 290</value>
<value>409, 313</value>
</data>
<data name="m_cancel.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
Expand All @@ -439,7 +466,7 @@
<value>Bottom, Right</value>
</data>
<data name="m_help.Location" type="System.Drawing.Point, System.Drawing">
<value>491, 290</value>
<value>491, 313</value>
</data>
<data name="m_help.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
Expand Down Expand Up @@ -475,7 +502,7 @@
<value>6, 13</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>581, 326</value>
<value>581, 349</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Back up this Project</value>
Expand Down
15 changes: 15 additions & 0 deletions Src/FwCoreDlgs/BackupRestore/BackupProjectPresenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@ internal String PersistanceFilePath
}
}

///<summary>
/// Returns true if the project has Send/Receive repository data (.hg or OtherRepositories).
///</summary>
internal bool SendReceiveDataExists
{
get
{
var projectFolder = m_cache.ProjectId.ProjectFolder;
return Directory.Exists(Path.Combine(projectFolder, ".hg")) ||
(Directory.Exists(LcmFileHelper.GetOtherRepositoriesDir(projectFolder)) &&
Directory.EnumerateDirectories(LcmFileHelper.GetOtherRepositoriesDir(projectFolder))
.Any(dir => Directory.Exists(Path.Combine(dir, ".hg"))));
}
}

///<summary>
/// If the SupportingFiles folder contains any files return true. Otherwise resturn false.
///</summary>
Expand Down
9 changes: 9 additions & 0 deletions Src/FwCoreDlgs/BackupRestore/RestoreProjectDlg.Designer.cs

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

12 changes: 12 additions & 0 deletions Src/FwCoreDlgs/BackupRestore/RestoreProjectDlg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,15 @@ public bool SpellCheckAdditions
set { m_spellCheckAdditions.Checked = value; }
}

///<summary>
/// Whether or not user wants Send/Receive repository data restored.
///</summary>
public bool SendReceiveData
{
get { return m_sendReceiveData.Checked; }
set { m_sendReceiveData.Checked = value; }
}

/// ------------------------------------------------------------------------------------
/// <summary>
/// Sets the backup file settings and updates the dialog controls accordingly
Expand Down Expand Up @@ -363,6 +372,8 @@ private void SetDialogControlsFromBackupSettings(BackupFileSettings settings, St
m_supportingFiles.Enabled = settings.IncludeSupportingFiles;
m_spellCheckAdditions.Checked = settings.IncludeSpellCheckAdditions;
m_spellCheckAdditions.Enabled = settings.IncludeSpellCheckAdditions;
m_sendReceiveData.Checked = settings.IncludeSendReceiveData;
m_sendReceiveData.Enabled = false;
if (m_rdoDefaultFolder.Checked)
m_lblDefaultBackupIncludes.Text = m_presenter.IncludesFiles(settings);
else
Expand Down Expand Up @@ -591,6 +602,7 @@ private void UpdateSettingsFromControls()
m_settings.IncludeLinkedFiles = LinkedFiles;
m_settings.IncludeSupportingFiles = SupportingFiles;
m_settings.IncludeSpellCheckAdditions = SpellCheckAdditions;
m_settings.IncludeSendReceiveData = SendReceiveData;
}

/// ------------------------------------------------------------------------------------
Expand Down
Loading
Loading