Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Changes #10

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
6e96e46
Merge pull request #4 from dgaspary/master
joecare99 Oct 30, 2019
356d956
Merge pull request #5 from joecare99/master
joecare99 Oct 30, 2019
b1769e2
Included the "include-files"
joecare99 Oct 31, 2019
d6b6b84
Included the other projects
joecare99 Oct 31, 2019
a810877
Re-renamed FindStyle back to Find. (with refractoring)
joecare99 Oct 31, 2019
5e625ea
Documentation about Find method
joecare99 Oct 31, 2019
4f7554e
Excluded *.lps and *.bak from project (*.lps contain User-configurati…
joecare99 Oct 31, 2019
30fc043
New Demo-part Tabulators (to show AddTab)
joecare99 Oct 31, 2019
2b7d65a
Minor change in tst_fpOdfBasics.pas
joecare99 Oct 31, 2019
d43b8a7
Ignore: *.lps *.bak (explained before)
joecare99 Oct 31, 2019
3ac117a
ignore: *.lps
joecare99 Oct 31, 2019
df49cec
Merge pull request #6 from dgaspary/master
joecare99 Oct 31, 2019
df2c3eb
Merge branch 'master' into NewFeatures_1
joecare99 Oct 31, 2019
568cc20
Merge pull request #8 from joecare99/NewFeatures_1
joecare99 Oct 31, 2019
e5f9beb
Create Repo-Sync.yml
joecare99 Nov 11, 2019
3a53b46
Update Repo-Sync.yml
joecare99 Nov 11, 2019
5641b40
Merge branch 'master' into MasterChanges
joecare99 Nov 18, 2019
65dd9f3
Merge pull request #12 from joecare99/MasterChanges
joecare99 Nov 18, 2019
f0b2281
Merge pull request #13 from joecare99/MasterChanges
joecare99 Nov 19, 2019
79cb1c6
Merge pull request #14 from dgaspary/master
joecare99 Sep 5, 2020
1b44f5f
joecare99 Mar 23, 2021
da0ca9b
Merge pull request #15 from dgaspary/master
joecare99 May 5, 2021
7c3b016
Merge pull request #16 from joecare99/MasterChanges
joecare99 May 5, 2021
befa368
Add files via upload
joecare99 May 5, 2021
79bf8f7
Merged and reworked Changes (Image, Table, Tests)
joecare99 Jun 19, 2024
2f73e42
Merge pull request #17 from joecare99/Merge_Changes
joecare99 Jun 19, 2024
2722ae8
Create readme.md
joecare99 Jun 21, 2024
5ec5f76
Some example-images to show off the capabilities
joecare99 Jun 21, 2024
71c60b8
Merge pull request #18 from joecare99/Examples
joecare99 Jun 21, 2024
ed8a362
Update readme.md
joecare99 Jun 21, 2024
779dc85
Update README.md
joecare99 Jun 21, 2024
5a8269d
Update README.md
joecare99 Jun 21, 2024
c211ca1
Update readme.md
joecare99 Jun 21, 2024
4534be0
Small reworks
joecare99 Jun 21, 2024
e7a4a70
Merge pull request #19 from joecare99/Merge_Changes
joecare99 Jun 21, 2024
17ed1e7
Merge pull request #20 from joecare99/master
joecare99 Jun 21, 2024
635b951
More comments & documentation
joecare99 Jun 21, 2024
31cb49e
Merge pull request #21 from joecare99/Merge_Changes
joecare99 Jun 21, 2024
6bdf35e
add github-actions
theavege Jan 4, 2025
dba7afb
add github-actions
theavege Jan 7, 2025
b3ca501
Merge pull request #24 from theavege/add/github-actions
joecare99 Jan 8, 2025
100541b
Merge branch 'MasterChanges' of https://github.com/joecare99/fpOdf
joecare99 Jan 8, 2025
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
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
18 changes: 18 additions & 0 deletions .github/workflows/Repo-Sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# File: .github/workflows/repo-sync.yml
name: Repo-Sync

on:
schedule:
- cron: "35 */3 * * *"
jobs:
repo-sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: repo-sync
uses: repo-sync/github-sync@v2
with:
source_repo: "dgaspary/fpOdf"
source_branch: "master"
destination_branch: "MasterChanges"
github_token: ${{ secrets.GITHUB_TOKEN }}
7 changes: 7 additions & 0 deletions .github/workflows/make.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"app" : "examples",
"lib" : "package",
"tst" : "test/fpOdfTest.lpi",
"pkg" : [
]
}
187 changes: 187 additions & 0 deletions .github/workflows/make.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
#!/usr/bin/env pwsh
##############################################################################################################

Function Show-Usage {
"
vagrant = 'it-gro/win10-ltsc-eval'
download = 'https://microsoft.com/en-us/evalcenter'
package = 'https://learn.microsoft.com/en-us/mem/configmgr/develop/apps/how-to-create-the-windows-installer-file-msi'
shell = 'https://learn.microsoft.com/en-us/powershell'

Usage: pwsh -File $($PSCommandPath) [OPTIONS]
Options:
build
lint
" | Out-Host
}

Function Build-Project {
New-Variable -Option Constant -Name VAR -Value (Get-Content -Path $PSCommandPath.Replace('ps1', 'json') | ConvertFrom-Json)
If (! (Test-Path -Path $Var.app)) {
"$([char]27)[31m.... $($Var.app) did not find!$([char]27)[0m" | Out-Host
Exit 1
}
If (Test-Path -Path '.gitmodules') {
& git submodule update --init --recursive --force --remote | Out-Host
"$([char]27)[33m.... [[$($LastExitCode)]] git submodule update$([char]27)[0m" | Out-Host
}
@(
@{
Cmd = 'lazbuild'
Url = 'https://fossies.org/windows/misc/lazarus-3.6-fpc-3.2.2-win64.exe'
Path = "C:\Lazarus"
}
) | Where-Object {
! (Test-Path -Path $_.Path)
} | ForEach-Object {
$_.Url | Request-File | Install-Program
$Env:PATH+=";$($_.Path)"
Return (Get-Command $_.Cmd).Source
} | Out-Host
$VAR.Pkg | ForEach-Object {
@{
Name = $_
Uri = "https://packages.lazarus-ide.org/$($_).zip"
Path = "$($Env:HOME)\.lazarus\onlinepackagemanager\packages\$($_)"
OutFile = (New-TemporaryFile).FullName
}
} | Where-Object {
! (Test-Path -Path $_.Path) &&
! (& lazbuild --verbose-pkgsearch $_.Name ) &&
! (& lazbuild --add-package $_.Name)
} | ForEach-Object -Parallel {
Invoke-WebRequest -OutFile $_.OutFile -Uri $_.Uri
New-Item -Type Directory -Path $_.Path | Out-Null
Expand-Archive -Path $_.OutFile -DestinationPath $_.Path
Remove-Item $_.OutFile
(Get-ChildItem -Filter '*.lpk' -Recurse -File –Path $_.Path).FullName |
ForEach-Object {
& lazbuild --add-package-link $_ | Out-Null
Return "$([char]27)[33m.... [$($LastExitCode)] add package link $($_)$([char]27)[0m"
}
} | Out-Host
If (Test-Path -Path $VAR.lib) {
(Get-ChildItem -Filter '*.lpk' -Recurse -File –Path $VAR.lib).FullName |
ForEach-Object {
& lazbuild --add-package-link $_ | Out-Null
Return "$([char]27)[33m.... [$($LastExitCode)] add package link $($_)$([char]27)[0m"
} | Out-Host
}
Exit $(Switch (Test-Path -Path $Var.tst) {
true {
$Output = (
& lazbuild --build-all --recursive --no-write-project $VAR.tst |
Where-Object {
$_.Contains('Linking')
} | ForEach-Object {
$_.Split(' ')[2].Replace('bin', 'bin\.')
}
)
$Output = (& $Output --all --format=plain --progress)
$exitCode = Switch ($LastExitCode) {
0 {0}
Default {
1
}
}
$Output | Out-Host
Return $exitCode
K }
Default {0}
}) + (
(Get-ChildItem -Filter '*.lpi' -Recurse -File –Path $Var.app).FullName |
ForEach-Object {
$Output = (& lazbuild --build-all --recursive --no-write-project $_)
$Result = @("$([char]27)[32m.... [$($LastExitCode)] build project $($_)$([char]27)[0m")
$exitCode = $(Switch ($LastExitCode) {
0 {
$Result += $Output | Select-String -Pattern 'Linking'
0
}
Default {
$Result += $Output | Select-String -Pattern 'Error:', 'Fatal:'
1
}
})
$Result | Out-Host
Return $exitCode
} | Measure-Object -Sum
).Sum
}

Function Request-File {
While ($Input.MoveNext()) {
New-Variable -Option Constant -Name VAR -Value @{
Uri = $Input.Current
OutFile = (Split-Path -Path $Input.Current -Leaf).Split('?')[0]
}
Invoke-WebRequest @VAR
Return $VAR.OutFile
}
}

Function Install-Program {
While ($Input.MoveNext()) {
Switch ((Split-Path -Path $Input.Current -Leaf).Split('.')[-1]) {
'msi' {
& msiexec /passive /package $Input.Current | Out-Null
}
Default {
& ".\$($Input.Current)" /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART | Out-Null
}
}
Remove-Item $Input.Current
}
}

Function Request-URL([Switch] $Post) {
$VAR = Switch ($Post) {
true {
@{
Method = 'POST'
Headers = @{
ContentType = 'application/json'
}
Uri = 'https://postman-echo.com/post'
Body = @{
One = '1'
} | ConvertTo-Json
}
}
false {
@{
Uri = 'https://postman-echo.com/get'
}
}
}
Return (Invoke-WebRequest @VAR | ConvertFrom-Json).Headers
}

Function Switch-Action {
$ErrorActionPreference = 'stop'
Set-PSDebug -Strict #-Trace 1
Invoke-ScriptAnalyzer -EnableExit -Path $PSCommandPath
If ($args.count -gt 0) {
Switch ($args[0]) {
'lint' {
Invoke-ScriptAnalyzer -EnableExit -Recurse -Path '.'
(Get-ChildItem -Filter '*.ps1' -Recurse -Path '.').FullName |
ForEach-Object {
Invoke-Formatter -ScriptDefinition $(Get-Content -Path $_ | Out-String) |
Set-Content -Path $_
}
}
'build' {
Build-Project
}
Default {
Show-Usage
}
}
} Else {
Show-Usage
}
}

##############################################################################################################
Switch-Action @args
112 changes: 112 additions & 0 deletions .github/workflows/make.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
#!/usr/bin/env bash
##############################################################################################################

function priv_clippit
(
cat <<EOF
https://google.github.io/styleguide/shellguide.html
https://guide.bash.academy
https://devhints.io/bash
https://tldr.sh

Usage: bash ${0} [OPTIONS]
Options:
build Build program
EOF
)

function priv_lazbuild
(
mapfile -t < "${0//sh/json}"
declare -rA VAR=(
[app]=$(jq --raw-output --exit-status '.app' <<< "${MAPFILE[@]}")
[lib]=$(jq --raw-output --exit-status '.lib' <<< "${MAPFILE[@]}")
[tst]=$(jq --raw-output --exit-status '.tst' <<< "${MAPFILE[@]}")
[opt]=$(jq --raw-output --exit-status '.opt' <<< "${MAPFILE[@]}")
)
if ! [[ -d "${VAR[app]}" ]]; then
printf '\x1b[32m\t[%s] did not find!\x1b[0m\n' "${VAR[app]}"
exit 1
fi >&2
if [[ -f '.gitmodules' ]]; then
git submodule update --init --recursive --force --remote &
fi
if ! (command -v lazbuild); then
# shellcheck source=/dev/null
source '/etc/os-release'
case ${ID:?} in
debian | ubuntu)
sudo apt-get update
sudo apt-get install -y lazarus{-ide-qt5,} &
;;
esac
fi &>/dev/null
wait
while read -r; do
(
declare -rA TMP=(
[url]="https://packages.lazarus-ide.org/${REPLY}.zip"
[dir]="${HOME}/.lazarus/onlinepackagemanager/packages/${REPLY}"
[out]=$(mktemp)
)
if ! [[ -d "${TMP[dir]}" ]] &&
! (lazbuild --verbose-pkgsearch "${REPLY}") &&
! (lazbuild --add-package "${REPLY}"); then
wget --quiet --output-document "${TMP[out]}" "${TMP[url]}"
mkdir --parents "${TMP[dir]}"
unzip -o "${TMP[out]}" -d "${TMP[dir]}"
rm --verbose "${TMP[out]}"
find "${TMP[dir]}" -type 'f' -name '*.lpk' -printf '\033[33m\tadd package link\t%p\033[0m\n' -exec \
lazbuild --add-package-link {} + >&2
fi
) &
done < <(jq --raw-output --exit-status '.pkg[]' <<< "${MAPFILE[@]}")
wait
if [[ -d "${VAR[lib]}" ]]; then
find "${VAR[lib]}" -type 'f' -name '*.lpk' -printf '\033[33m\tadd package link\t%p\033[0m\n' -exec \
lazbuild --add-package-link {} + >&2
fi
declare -i exitCode=0
if [[ -f "${VAR[tst]}" ]]; then
declare -A TMP=(
[tst]=$(
lazbuild --build-all --recursive --no-write-project "${VAR[tst]}" |
awk '/Linking/{print $3}'
)
)
if ! ("${TMP[tst]}" --all --format=plain --progress >&2); then
((exitCode+=1))
fi
fi
while read -r; do
declare -A TMP=(
[out]=$(mktemp)
)
if (lazbuild --build-all --recursive --no-write-project "${REPLY}" > "${TMP[out]}"); then
printf '\x1b[32m\t[%s]\t%s\x1b[0m\n' "${?}" "${REPLY}"
grep --color='always' 'Linking' "${TMP[out]}"
else
printf '\x1b[31m\t[%s]\t%s\x1b[0m\n' "${?}" "${REPLY}"
grep --color='always' --extended-regexp '(Error|Fatal):' "${TMP[out]}"
((exitCode+=1))
fi >&2
rm "${TMP[out]}"
done < <(find "${VAR[app]}" -type 'f' -name '*.lpi')
exit "${exitCode}"
)

function priv_main
(
set -euo pipefail
if ((${#})); then
case ${1} in
build) priv_lazbuild ;;
*) priv_clippit ;;
esac
else
priv_clippit
fi
)

##############################################################################################################
priv_main "${@}" >/dev/null
49 changes: 49 additions & 0 deletions .github/workflows/make.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
name: Make

on:
schedule:
- cron: '0 0 1 * *'
push:
branches:
- "**"
pull_request:
branches:
- master
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 120
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Build on Linux
if: runner.os == 'Linux'
shell: bash
run: bash .github/workflows/make.sh build

- name: Build on Windows
if: runner.os == 'Windows'
shell: powershell
run: pwsh -File .github/workflows/make.ps1 build

- name: Archive
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
retention-days: 1
path: src\bin\*.exe
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/.svn
/bin
/output
*.lps
*.bak
Loading
Loading