Skip to content

Commit

Permalink
Extracted backend and tools to own repos
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianeicher committed Aug 24, 2017
1 parent acc14ef commit 375942b
Show file tree
Hide file tree
Showing 1,048 changed files with 2,269 additions and 98,204 deletions.
3 changes: 0 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,3 @@
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/build/
/src/packages/*/
/src/.vs/
/src/.idea/
/src/_ReSharper*/
bin/
/src/packages/
/release/*.xml
/release/*.tar.gz
obj/
test-results/
bin/
*.bak
*.cache
*.pidb
Expand All @@ -14,4 +14,3 @@ test-results/
*.userprefs
*.resources
*.filtered.resx
*.wixobj
71 changes: 21 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,34 @@
Zero Install
============
Zero Install for Windows
========================

Zero Install is a decentralized cross-platform software-installation system available under the LGPL.

- **[Website](http://0install.de/)**
- **[Developer information](http://0install.de/dev/)**

Zero Install for Windows is built upon the [Zero Install .NET Backend](https://github.com/0install/dotnet-backend).

Source directory structure
--------------------------
- The directory `src` contains the Visual Studio solution with the actual source code.
- The directory `lib` contains pre-compiled 3rd party libraries which are not available via NuGet.
- The directory `doc` contains scripts for generating source code documentation.
- The directory `nuget` contains NuGet spec files used to generate NuGet packages for Zero Install.
- The directory `powershell` contains scripts for creating PowerShell modules.
- The directory `publish` contains scripts for creating feeds and archives for publishing.
- The directory `build` contains the results of various compilation processes. It is created on first usage. It can contain the following subdirectories:
- `Debug`|`DebugNet35`|`DebugNet35`: Contains Debug builds targeting the .NET Framework 4.0, 3.5 and 2.0 respectively.
- `Release`|`ReleaseNet35`|`ReleaseNet35`: Contains Release builds targeting the .NET Framework 4.0, 3.5 and 2.0 respectively.
- `Backend`: Contains the libraries forming the Zero Install Backend.
- `Frontend`: Contains the executables for the Zero Install Frontend plus all required libraries (including the Backend).
- `Tools`: Contains the executables for Zero Install Tools such as the Feed Editor plus all required libraries (including the Backend).
- `Samples`: Contains the executables for the Zero Install API samples.
- `Bootstrap`: Contains a standalone executable enabling end-users to aquire published feeds and archives.
- `Documentation`: Contains the generated source code documentation.
- `Packages`: Contains the generated NuGet packages.
- `Modules`: Contains the generated PowerShell modules.
- `Publish`: Contains the generated feeds and archives for publishing.
- The top-level directory contains local Zero Install feeds referencing the contents of the `build` directory. They can be registered with `0install add-feed` in order to replace the online versions of Zero Install and its tools with your local builds.
Directory structure
-------------------
- `src` contains source code.
- `lib` contains pre-compiled 3rd party libraries which are not available via NuGet.
- `doc` contains scripts for generating source code documentation.
- `nuget` contains NuGet spec files used to generate NuGet packages for Zero Install.
- `powershell` contains scripts for creating PowerShell modules.
- `build` contains the results of various compilation processes. It is created on first usage.
- `release` contains scripts for creating a Zero Install feed and archive for publishing a build.

`VERSION` contains the version number used by build scripts.
Use `.\Set-Version.ps1 "X.Y.Z"` in PowerShall to change the version number. This ensures that the version also gets set in other locations (e.g. AssemblyInfo).


Building on Windows
-------------------
`build.cmd` will call build scripts in subdirectories to create a Zero Install for Windows release.

If you wish to add an AuthentiCode signature to the compiled binaries set the `signing_cert_path` environment variable to the certificate's file path and `signing_cert_pass` to the password used to decrypt the file before executing the build scripts.
For example:
```
set signing_cert_path=C:\mycert.pfx
set signing_cert_pass=mypass
build.cmd
```

If you wish to deploy the release after compilation as the default Zero Install instance in your user profile run `build.cmd deploy`. To deploy it for all users use `build.cmd deploy --machine` instead.

`cleanup.cmd` will delete any temporary files created by the build process or Visual Studio.


Building on Linux
-----------------
`build.sh` will perform a partial debug compilation using Mono's xbuild. Some parts of a full release can currently only be built on Windows.

`cleanup.sh` will delete any temporary files created by the xbuild build process.

`test.sh` will run the unit tests using the NUnit console runner.
Note: You must perform a Debug build first (using `src/build.sh`) before you can run the unit tests.

Building
--------
- You need to install [Visual Studio 2017](https://www.visualstudio.com/downloads/) to build this project.
- The file `VERSION` contains the current version number of the project.
- Run `.\Set-Version.ps1 "X.Y.Z"` in PowerShall to change the version number. This ensures that the version also gets set in other locations (e.g. `GlobalAssemblyInfo.cs`).
- Run `.\build.ps1` in PowerShell to build everything.
- If you wish to deploy the release after compilation as the default Zero Install instance in your user profile run `.\build.ps1 -Deploy`.
- To deploy it for all users use `.\build.ps1 -Deploy -Machine`.

Environment variables
---------------------
Expand Down
28 changes: 10 additions & 18 deletions Set-Version.ps1
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
Param ([Parameter(Mandatory=$True)] [string]$NewVersion)
#Sets a new version number in all relevant locations
$ErrorActionPreference = "Stop"
$ScriptDir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent

[System.IO.File]::WriteAllText("$ScriptDir\VERSION", $NewVersion)

(Get-Content "$ScriptDir\src\GlobalAssemblyInfo.cs" -Encoding UTF8) `
-replace 'AssemblyVersion\(".*"\)', ('AssemblyVersion("' + $NewVersion + '")') |
Set-Content "$ScriptDir\src\GlobalAssemblyInfo.cs" -Encoding UTF8
(Get-Content "$ScriptDir\src\Frontend\OneGet\provider.manifest" -Encoding UTF8) `
-replace 'version=".*" versionScheme="multipartnumeric"', ('version="' + $NewVersion + '.0" versionScheme="multipartnumeric"') |
Set-Content "$ScriptDir\src\Frontend\OneGet\provider.manifest" -Encoding UTF8
function SearchAndReplace($FilePath, $PatternLeft, $PatternRight)
{
(Get-Content "$ScriptDir\$FilePath" -Encoding UTF8) `
-replace "$PatternLeft.*$PatternRight", ($PatternLeft.Replace('\', '') + $NewVersion + $PatternRight.Replace('\', '')) |
Set-Content "$ScriptDir\$FilePath" -Encoding UTF8
}

(Get-Content "$ScriptDir\doc\Backend.Doxyfile" -Encoding UTF8) `
-replace 'PROJECT_NUMBER = ".*"', ('PROJECT_NUMBER = "' + $NewVersion + '"') |
Set-Content "$ScriptDir\doc\Backend.Doxyfile" -Encoding UTF8
(Get-Content "$ScriptDir\doc\Frontend.Doxyfile" -Encoding UTF8) `
-replace 'PROJECT_NUMBER = ".*"', ('PROJECT_NUMBER = "' + $NewVersion + '"') |
Set-Content "$ScriptDir\doc\Frontend.Doxyfile" -Encoding UTF8
(Get-Content "$ScriptDir\doc\Tools.Doxyfile" -Encoding UTF8) `
-replace 'PROJECT_NUMBER = ".*"', ('PROJECT_NUMBER = "' + $NewVersion + '"') |
Set-Content "$ScriptDir\doc\Tools.Doxyfile" -Encoding UTF8
[System.IO.File]::WriteAllText("$ScriptDir\VERSION", $NewVersion)
SearchAndReplace doc\Doxyfile -PatternLeft 'PROJECT_NUMBER = "' -PatternRight '"'
SearchAndReplace src\GlobalAssemblyInfo.cs -PatternLeft 'AssemblyVersion\("' -PatternRight '"\)'
SearchAndReplace src\OneGet\provider.manifest -PatternLeft 'version="' -PatternRight '" versionScheme="multipartnumeric"'
8 changes: 8 additions & 0 deletions Set-Version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -e
cd `dirname $0`

printf $1 > VERSION
sed -b -i "s/PROJECT_NUMBER = \".*\"/PROJECT_NUMBER = \"$1\"/" doc/Doxyfile
sed -b -i "s/AssemblyVersion\(\".*\"\)/AssemblyVersion\(\"$1\"\)/" src/GlobalAssemblyInfo.cs
sed -b -i "s/version=\".*\" versionScheme=\"multipartnumeric\"/version=\"$1\" versionScheme=\"multipartnumeric\"/" src/OneGet/provider.manifest
40 changes: 0 additions & 40 deletions build.cmd

This file was deleted.

20 changes: 20 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Param ([Switch]$Deploy, [Switch]$Machine)
$ErrorActionPreference = "Stop"

$RootDir = $(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)
pushd $RootDir

src\build.ps1
doc\build.ps1
release\build.ps1
powershell\build.ps1

if ($Deploy) {
if ($Machine) {
build\Bootstrap\zero-install.exe --feed="$RootDir\release\ZeroInstall-$(Get-Content ..\VERSION).xml" maintenance --batch --machine
} else {
build\Bootstrap\zero-install.exe --feed="$RootDir\release\ZeroInstall-$(Get-Content ..\VERSION).xml" maintenance --batch
}
}

popd
5 changes: 3 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh
#Compiles the source code.
set -e
cd `dirname $0`

#Create debug build
src/build.sh
doc/build.sh
release/build.sh
55 changes: 0 additions & 55 deletions cleanup.cmd

This file was deleted.

20 changes: 0 additions & 20 deletions cleanup.sh

This file was deleted.

22 changes: 0 additions & 22 deletions doc/Backend.Doxyfile

This file was deleted.

3 changes: 0 additions & 3 deletions doc/Backend.md

This file was deleted.

21 changes: 21 additions & 0 deletions doc/Doxyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
PROJECT_NAME = "Zero Install Frontend API"
PROJECT_NUMBER = "2.13.3"

INPUT = main.md ../src
USE_MDFILE_AS_MAINPAGE = main.md
STRIP_FROM_PATH = ../src
RECURSIVE = YES
EXCLUDE_PATTERNS = */UnitTests/* */Properties/* */obj/* */bin/* *.NativeMethods.cs */gtk-gui/*
TAGFILES = nanobyte-common.tag=http://nano-byte.de/common/api/ 0install-backend.tag=http://0install.de/api/backend/

OUTPUT_DIRECTORY = ../build/Documentation
HTML_OUTPUT = .

GENERATE_LATEX = NO
CASE_SENSE_NAMES = NO

EXTRACT_PACKAGE = YES
EXTRACT_STATIC = YES
AUTOLINK_SUPPORT = NO
WARN_IF_UNDOCUMENTED = NO
QUIET = YES
22 changes: 0 additions & 22 deletions doc/Frontend.Doxyfile

This file was deleted.

Loading

0 comments on commit 375942b

Please sign in to comment.