Skip to content

Commit

Permalink
Update v1.7.0 (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
DSPaul authored Mar 10, 2024
2 parents c32fab7 + 3a1447f commit 310cbe4
Show file tree
Hide file tree
Showing 169 changed files with 6,167 additions and 2,630 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: build and test

on:
pull_request:
branches: [ main ]
paths:
- '**.cs'
- '**.csproj'
push:
branches: [ dev ]

env:
DOTNET_VERSION: '7.0.x' # The .NET SDK version to use

jobs:
build-and-test:

name: build-and-test
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Setup Chrome
uses: browser-actions/[email protected]

- name: Install dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Test
run: dotnet test --no-restore -v normal --filter Priority!=2

- name: Upload Log Artifact
if: failure()
uses: actions/upload-artifact@v4
with:
name: log-file
#using $env{appdata} did't work so use this for now, fine until cross platform
path: C:\Users\runneradmin\AppData\Roaming\COMPASS\logs\test.log
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ artifacts/


# Others
Deployment/
Images/
Deployment/InnoSetup/
Deployment/Versions/
~$*
*~
*.dbmdl
Expand All @@ -91,4 +92,9 @@ src/GlobalSuppressions.cs
AnalysisReport.sarif
upgrade-assistant.clef
TagTrees/
.idea
.idea
Deployment/release-notes-template.md
Deployment/changes.md
*.coverage
Tests/coverage.cobertura.xml
Tests/report
2 changes: 1 addition & 1 deletion COMPASS.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "COMPASS", "src\COMPASS.csproj", "{8AAD94A3-CE1C-41AC-8C2C-9AECE359651F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "COMPASS_Tests", "COMPASS_Tests\COMPASS_Tests.csproj", "{36C105FE-D96C-4470-994F-DE2CC45FCB27}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests", "Tests\Tests.csproj", "{36C105FE-D96C-4470-994F-DE2CC45FCB27}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
23 changes: 0 additions & 23 deletions COMPASS_Tests/COMPASS_Tests.csproj

This file was deleted.

9 changes: 0 additions & 9 deletions COMPASS_Tests/UnitTest1.cs

This file was deleted.

37 changes: 37 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
# CHANGELOG

## COMPASS v1.7.0 (25 February 2024)

### New Features

- IMPORT & EXPORT are here in the form of `Satchels`! In this new update you can:
- Export collections to a new .satchel file to share with your friends. Exports can include:
- the tags from a collection
- the items in the collection (such as books and maps) including their metadata, cover art and even the files referenced by those items such as pdf's.
- your settings for that collection such as which file types to exclude from import
- Import those .satchel files to merge all of its content into one of your existing collections or add it as brand new collection.
- Both during import and export, you can pick and choose which tags, books and settings you want to keep using a user friendly wizard. You can access this new feature by using the new "Import" and "Export" options near the collections at the top.
- If you only want to import only the tags, you can go to "Import Tags" > "From a .satchel file" in the "Tags" Tab.
- If you only want to import the items without any tags, you can select "From a .satchel file" in the "Add Books" Tab.
- You can find more info about the new .satchel file format [here](https://github.com/DSPaul/COMPASS/tree/master/Docs/Satchels.md).
- You can now merge collections. This is especially handy when used in combination with import. If you would like to browse a collection you wish to import before merging it into your existing collections, you can simply import it as a new collection and merge it later.
- Added a new context menu to the tags tab which can be accessed by right clicking anywhere or clicking the vertical triple dots, with the following options
- Sort tags A->Z. [#31](https://github.com/DSPaul/COMPASS/issues/31)
- Export Tags.
- Importing from a folder now allows you to exclude certain subfolders. [#58](https://github.com/DSPaul/COMPASS/issues/58)

### Improvements

- Tags created using "quick new tag" are now automatically added to the item being edited.
- COMPASS now saves more often to prevent data loss.
- Info and warning tooltips now appear instantly.
- Added an explainer when zero-padding is applied to the sorting title.
- When auto import tries to import a new file type, it will now always ask what to do with it.
- Increased stability.
- When manually resolving a broken file reference, COMPASS will analyze how the file path changed and attempt to fix other broken links by applying the same change.

### Fixes

- Fixed tags being cleared when quick creating a tag.
- Fix total item count not updating.
- Cards in Card Layout can now resize thanks to an update to the [VirtualizingWrapPanel](https://github.com/sbaeumlisberger/VirtualizingWrapPanel) package. (thanks [@sbaeumlisberger](https://github.com/sbaeumlisberger)) This fixes [#62](https://github.com/DSPaul/COMPASS/issues/62)
- Fix metadata source priority preferences not persisting.

## COMPASS v1.6.0 (6 November 2023)

### Features
Expand Down
26 changes: 26 additions & 0 deletions Deployment/Deployment steps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Deployment Steps

## Increment Version (done by running $: py publish.py x.x.x)

- [x] Increment AssemblyInfo Version Number
- [x] Increment installer.iss Version Number
- [x] Update versionInfo.xml
- [x] Append changelog from changes.md to Changelog.md

## Build all the things (also done when running $: py publish.py x.x.x)

- [x] Build Release
- [x] Publish
- [x] Create installer using install.iss

## Test

- [ ] Run all the unit and integration tests
- [ ] Run setup file to make sure installer works

## Deploy to github

- [ ] Create a PR
- [ ] Create new github tag based on dev
- [ ] create new github release
- [ ] Merge the PR <-- must be done AFTER release
78 changes: 78 additions & 0 deletions Deployment/install.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "COMPASS"
#define MyAppVersion "1.7.0"
#define MyAppPublisher "Paul De Smul"
#define MyAppURL "https://www.compassapp.info"
#define MyAppExeName "COMPASS.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{6BB9B60C-E9A6-4342-9E26-663ACBE88F2C}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
ArchitecturesInstallIn64BitMode = x64
DisableProgramGroupPage=yes
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
OutputDir=Versions\{#MyAppVersion}
OutputBaseFilename=COMPASS_Setup_{#MyAppVersion}
Compression=lzma
SolidCompression=yes
WizardStyle=modern
ChangesAssociations = yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "..\src\bin\Publish\win-x64\*"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\src\bin\Publish\win-x64\Media\*"; DestDir: "{app}\Media"; Flags: ignoreversion
Source: "..\src\bin\Publish\win-x64\gs\*"; DestDir: "{app}\gs"; Flags: ignoreversion
Source: "..\src\bin\Publish\win-x64\selenium-manager\windows\*"; DestDir : "{app}\selenium-manager\windows"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[Registry]
; ----------- Register .satchel as a COMPASS file -------------- ;
; register the .sathel extension
Root: HKCR; Subkey: ".satchel"; ValueType: string; ValueName: ""; ValueData: "COMPASSSatchelFile"; Flags: uninsdeletevalue
; Give it a type name "COMPASS Satchel"
Root: HKCR; Subkey: "COMPASSSatchelFile"; ValueType: string; ValueName: ""; ValueData: "COMPASS Satchel"; Flags: uninsdeletekey
; Give it the COMPASS Icon
Root: HKCR; Subkey: "COMPASSSatchelFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\COMPASS.EXE,0"
; Make double click open the file using compass, not handled yet in COMPASS
; Root: HKCR; Subkey: "COMPASSSatchelFile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\COMPASS.EXE"" ""%1"""
; -------------------------------------------------------------- ;

[Code]
procedure CurUninstallStepChanged (CurUninstallStep: TUninstallStep);
var
mres : integer;
begin
case CurUninstallStep of
usPostUninstall:
begin
mres := MsgBox('Delete data on uninstall.', mbConfirmation, MB_YESNO or MB_DEFBUTTON2)
if mres = IDYES then
DelTree(ExpandConstant('{userappdata}\{#MyAppName}'), True, True, True);
end;
end;
end;
86 changes: 86 additions & 0 deletions Deployment/publish.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
from dataclasses import replace
from datetime import date
import os
import sys
import re

def replaceVersion(path, old, new):
with open(path, "r") as f:
data = f.read()
data = data.replace(old,new)
with open(path,"w") as f:
f.write(data)

def getOldVersion():
#open and read AssemblyInfo
with open(r"../src/Properties/AssemblyInfo.cs", "r+") as f:
data = f.read()
#find old version number
return re.findall(r".*\[assembly: AssemblyVersion\(\"(.+)\"\)\].*", data, re.MULTILINE)[0]

def IncrementVersions():
# Increment AssemblyInfo
replaceVersion(r"../src/Properties/AssemblyInfo.cs", OLD_VERSION, NEW_VERSION)
# Increment installer.iss
replaceVersion("install.iss", OLD_VERSION, NEW_VERSION)
# Increment versionInfo.xml
replaceVersion(r"../versionInfo.xml", OLD_VERSION,NEW_VERSION)

def WriteChangelog():

data = ""
# add changelog of this release to full changelog
if os.path.exists("changes.md"):
with open("changes.md", "r") as f:
data = f.read()

# make dir to put changelog in
dir = f"./Versions/{NEW_VERSION}"
if not os.path.exists(dir): os.mkdir(dir)

#create realease-notes file and write to it
notes = dir +f"/release-notes-{NEW_VERSION}.md"
openMode = "x" if not os.path.exists(notes) else "w"
with open(dir +f"/release-notes-{NEW_VERSION}.md",openMode) as f:
# append version number and date
today = date.today().strftime("%d %B %Y")
data = f"# COMPASS v{NEW_VERSION} ({today})\n\n" + data
f.write(data)

#append them to total Changelog
with open("../Changelog.md","r+") as f:
content = f.read()
f.seek(14) # skip "#CHANGELOG"
data = data.replace("# ","## ") # make titles one smaller
f.write(data + '\n' + content[13:])

#clear changes back to template
if os.path.exists("release-notes-template.md"):
with open("release-notes-template.md","r") as f:
data = f.read()
with open("changes.md","w") as f:
f.write(data)


def Build():
os.system(r"dotnet build ../COMPASS.sln -c Release")

def Publish():
os.system(r"dotnet publish ../COMPASS.sln -p:PublishProfile=FolderProfile.pubxml")

def CreateSetupFile():
os.system(r"InnoSetup\ISCC.exe install.iss")

# first arg: file name, second arg: version
NEW_VERSION = sys.argv[1]
OLD_VERSION = getOldVersion()

#switch to dev branch
#os.system("git checkout dev")

if NEW_VERSION != OLD_VERSION:
IncrementVersions()
WriteChangelog()
Build()
Publish()
CreateSetupFile()
36 changes: 36 additions & 0 deletions Docs/Satchels.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Import & export your collection: Satchels

## Overview

.satchel is a file format designed to share data between compass users.
Like many other existing file formats, .satchel is not a binary file but a renamed zip archive.

This means that you can inspect its content outside of COMPASS by renaming it back to .zip and opening it like any other archive. All the files inside are either .xml or .json files which are both human readable and editable.

## Contents

As single .satchel file corresponds to a single collection and can contain any of the following:

- A `SatchelInfo.json` file that contains the version of COMPASS that was used to create the satchel file, as well as the last compatible version for each component. More about compatibility in the next section.
- A `CodexInfo.xml` file containing all the items in the collections with their metadata such as their title, author, ect.
- A `CollectionInfo.xml` file containing info and preferences about the collection such as which filetypes to exclude from import and folder-tag links.
- A `Tags.xml` file containing all the tags for that collection.
- A `CoverArt` folder containing full res versions of the cover art of the items in `CodexInfo.xml`.
- A `Thumbnails` folder containing low res versions of the cover art of the items in `CodexInfo.xml`.
- A `Files` folder that contains files that were referenced by the `path` field of the items.

## Compatibility

Satchel files will always be forward compatible with newer versions of COMPASS, meaning they can be opened in any version of COMPASS that is equal to or greater than the version that was used to create it.

Backwards compatibility however poses challenges, as .satchel files created in newer versions may have changes in their data structure that older versions cannot interpret. Attempting to import these newer files anyway could result in data that has seen changes to its structure, getting lost in the import. It can also result in crashes and even possible file corruption of your existing collections.

Because of these dangers, satchels always include the minimum required version of COMPASS to properly open and interpret each of its 3 xml files (`CodexInfo.xml`, `CollectionInfo.xml` and `Tags.xml`). If any of these xml files are present and marked incompatible, COMPASS will refuse to import the satchel.

If you wish to import such an incompatible .satchel file, you will have to update your install to match the target version. If however you do not want to update, you can always manually modify the necessary files to match the old format by referencing the included changelog, and then change the `SatchelInfo.json` file manually to match your installed version.

## Format changes

### Version 1.7.0

Introduction of the format.
Loading

0 comments on commit 310cbe4

Please sign in to comment.