Skip to content

Commit 9faaa55

Browse files
authored
Merge pull request #7 from tukanos/NeoJSONUpdate
NeoJson update
2 parents 5f6dc72 + 849b748 commit 9faaa55

File tree

759 files changed

+10486
-1170
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

759 files changed

+10486
-1170
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# inform linguist that files with these extensions are indeed smalltalk files
2+
*.st linguist-language=Smalltalk
3+
*.gs linguist-language=Smalltalk

.github/workflows/build.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build
2+
3+
on: [ push, pull_request, workflow_dispatch ]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
smalltalk: [ Pharo64-13, Pharo64-12, Pharo64-11, Pharo64-10, Pharo64-9.0, Pharo64-8.0, Pharo64-7.0 ]
11+
name: ${{ matrix.smalltalk }}
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up Smalltalk CI
15+
uses: hpi-swa/setup-smalltalkCI@v1
16+
with:
17+
smalltalk-image: ${{ matrix.smalltalk }}
18+
- name: Load Image and Run Tests
19+
run: smalltalkci -s ${{ matrix.smalltalk }} .smalltalkci/.unit-tests.ston
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
timeout-minutes: 15
23+
- name: Upload coverage to Codecov
24+
uses: codecov/codecov-action@v1
25+
with:
26+
name: ${{matrix.os}}-${{matrix.smalltalk}}
27+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: smalltalkCI
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches:
7+
gemstone
8+
schedule:
9+
- cron: "15 2 9 * *" #run job on the 9th day of every month on the 15th minute of the 2nd hour
10+
11+
jobs:
12+
build:
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ ubuntu-latest ]
17+
smalltalk: [ GemStone64-3.7.2, GemStone64-3.7.4.3 ]
18+
runs-on: ${{ matrix.os }}
19+
name: ${{ matrix.smalltalk }}
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: hpi-swa/setup-smalltalkCI@v1
23+
with:
24+
smalltalk-image: ${{ matrix.smalltalk }}
25+
- name: Run tests
26+
run: smalltalkci -s ${{ matrix.smalltalk }}
27+
shell: bash
28+
timeout-minutes: 20
29+
slack-workflow-status:
30+
if: always()
31+
name: Post Workflow Status To Slack
32+
needs:
33+
- build
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Slack Workflow Notification
37+
uses: Gamesight/slack-workflow-status@master
38+
with:
39+
repo_token: ${{secrets.GITHUB_TOKEN}}
40+
slack_webhook_url: ${{secrets.SLACK_DALEHENRICH}}
41+
name: 'action run'

.nix/flake.lock

Lines changed: 85 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.nix/flake.nix

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
{
2+
description = "Flake for svenvc/neojson";
3+
4+
inputs = rec {
5+
flake-utils.url = "github:numtide/flake-utils/v1.0.0";
6+
nixpkgs.url = "github:NixOS/nixpkgs/release-24.11";
7+
pharo-vm-12 = {
8+
inputs.nixpkgs.follows = "nixpkgs";
9+
url = "github:rydnr/nix-flakes/pharo-vm-12.0.1519.2?dir=pharo-vm";
10+
};
11+
};
12+
outputs = inputs:
13+
with inputs;
14+
flake-utils.lib.eachDefaultSystem (system:
15+
let
16+
org = "svenvc";
17+
repo = "neojson";
18+
pname = "${repo}";
19+
tag = "v18";
20+
baseline = "NeoJSON";
21+
pkgs = import nixpkgs { inherit system; };
22+
description = "An elegant and efficient Smalltalk framework to read and write JSON converting to or from Smalltalk objects";
23+
license = pkgs.lib.licenses.mit;
24+
homepage = "https://github.com/svenvc/neojson";
25+
maintainers = with pkgs.lib.maintainers; [ ];
26+
nixpkgsVersion = builtins.readFile "${nixpkgs}/.version";
27+
nixpkgsRelease =
28+
builtins.replaceStrings [ "\n" ] [ "" ] "nixpkgs-${nixpkgsVersion}";
29+
shared = import ./shared.nix;
30+
svenvc-neojson-for = { bootstrap-image-name, bootstrap-image-sha256, bootstrap-image-url, pharo-vm }:
31+
let
32+
bootstrap-image = pkgs.fetchurl {
33+
url = bootstrap-image-url;
34+
sha256 = bootstrap-image-sha256;
35+
};
36+
src = ./../repository;
37+
in pkgs.stdenv.mkDerivation (finalAttrs: {
38+
version = tag;
39+
inherit pname src;
40+
41+
strictDeps = true;
42+
43+
buildInputs = with pkgs; [
44+
];
45+
46+
nativeBuildInputs = with pkgs; [
47+
pharo-vm
48+
pkgs.unzip
49+
];
50+
51+
unpackPhase = ''
52+
unzip -o ${bootstrap-image} -d image
53+
# cp -r ${src} src
54+
'';
55+
56+
configurePhase = ''
57+
runHook preConfigure
58+
59+
# load baseline
60+
${pharo-vm}/bin/pharo image/${bootstrap-image-name} eval --save "EpMonitor current disable. NonInteractiveTranscript stdout install. [ Metacello new repository: 'filetree://${src}'; baseline: '${baseline}'; onConflictUseLoaded; load ] ensure: [ EpMonitor current enable ]"
61+
62+
runHook postConfigure
63+
'';
64+
65+
buildPhase = ''
66+
runHook preBuild
67+
68+
# assemble
69+
${pharo-vm}/bin/pharo image/${bootstrap-image-name} save "${pname}"
70+
71+
mkdir dist
72+
mv image/${pname}.* dist/
73+
74+
runHook postBuild
75+
'';
76+
77+
installPhase = ''
78+
runHook preInstall
79+
80+
mkdir -p $out
81+
cp -r ${pharo-vm}/bin $out
82+
cp -r ${pharo-vm}/lib $out
83+
cp -r dist/* $out/
84+
cp image/*.sources $out/
85+
mkdir $out/share
86+
pushd ${src}
87+
${pkgs.zip}/bin/zip -r $out/share/src.zip .
88+
popd
89+
90+
runHook postInstall
91+
'';
92+
93+
meta = {
94+
longDescription = ''
95+
NeoJSON is an elegant and efficient standalone Smalltalk framework to read and write JSON converting to or from Smalltalk objects.
96+
'';
97+
inherit description homepage license maintainers;
98+
mainProgram = "pharo";
99+
platforms = pkgs.lib.platforms.linux;
100+
};
101+
});
102+
in rec {
103+
defaultPackage = packages.default;
104+
devShells = rec {
105+
default = svenvc-neojson-12;
106+
svenvc-neojson-12 = shared.devShell-for {
107+
package = packages.svenvc-neojson-12;
108+
inherit org pkgs repo tag;
109+
nixpkgs-release = nixpkgsRelease;
110+
};
111+
};
112+
packages = rec {
113+
default = svenvc-neojson-12;
114+
svenvc-neojson-12 = svenvc-neojson-for rec {
115+
bootstrap-image-url = pharo-vm-12.resources.${system}.bootstrap-image-url;
116+
bootstrap-image-sha256 = pharo-vm-12.resources.${system}.bootstrap-image-sha256;
117+
bootstrap-image-name = pharo-vm-12.resources.${system}.bootstrap-image-name;
118+
pharo-vm = pharo-vm-12.packages.${system}.pharo-vm;
119+
};
120+
};
121+
});
122+
}

.nix/shared.nix

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# .nix/shared.nix
2+
#
3+
# This file provides functions used by NeoJSON's Nix flake.
4+
#
5+
# MIT License
6+
#
7+
# Copyright (C) 2012 Sven Van Caekenberghe
8+
#
9+
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10+
#
11+
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12+
#
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14+
rec {
15+
shellHook-for = { nixpkgs-release, org, package, repo, tag }:
16+
''
17+
export PS1="\033[37m[\[\033[01;34m\]${org}/${repo}\033[01;37m|\033[01;33m${tag}[\033[00m\] "
18+
echo -e "\033[36m▗▖  ▗▖▗▞▀▚▖ ▄▄▄ \033[31m ▗▖ ▗▄▄▖ ▗▄▖ ▗▖  ▗▖ \033[32mhttps://github.com/${org}\033[0m"
19+
echo -e "\033[36m▐▛▚▖▐▌▐▛▀▀▘█   █\033[31m ▐▌▐▌   ▐▌ ▐▌▐▛▚▖▐▌ \033[33mhttps://github.com/${org}/${repo}:${tag}\033[0m"
20+
echo -e "\033[36m▐▌ ▝▜▌▝▚▄▄▖▀▄▄▄▀\033[31m ▐▌ ▝▀▚▖▐▌ ▐▌▐▌ ▝▜▌ \033[34mhttps://pharo.org\033[0m"
21+
echo -e "\033[36m▐▌  ▐▌ \033[0m       \033[31m▗▄▄▞▘▗▄▄▞▘▝▚▄▞▘▐▌  ▐▌ \033[35mhttps://github.com/nixos/nixpkgs/tree/${nixpkgs-release}\033[0m"
22+
echo
23+
echo -e "Thank you for using \033[32m${package.pname}\033[0m \033[33m${package.version}\033[0m \033[31m(${org}/${repo}-${tag})\033[0m and for your appreciation of Smalltalk."
24+
'';
25+
devShell-for = { nixpkgs-release, org, package, pkgs, repo, tag}:
26+
pkgs.mkShell {
27+
shellHook = shellHook-for {
28+
inherit nixpkgs-release org package repo tag;
29+
};
30+
};
31+
app-for = { package, entrypoint }: {
32+
type = "app";
33+
program = "${package}/bin/${entrypoint}.sh";
34+
};
35+
}

.project

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
'srcDirectory' : 'repository'
3+
}

.smalltalk.ston

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
SmalltalkCISpec {
2+
#loading : [
3+
SCIMetacelloLoadSpec {
4+
#baseline : 'NeoJSON',
5+
#directory : 'filetree',
6+
#load : [ 'Core', 'Tests' ],
7+
#platforms : [ #gemstone ]
8+
}
9+
]
10+
}

.smalltalk_gemstone.ston

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
SmalltalkCISpec {
2+
#loading : [
3+
SCIMetacelloLoadSpec {
4+
#baseline : 'NeoJSON',
5+
#directory : 'filetree',
6+
#load : [ 'Core', 'Tests' ],
7+
#platforms : [ #gemstone ]
8+
}
9+
]
10+
}

.smalltalk_pharo.ston

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
SmalltalkCISpec {
2+
#loading : [
3+
SCIMetacelloLoadSpec {
4+
#baseline : 'NeoJSON',
5+
#directory : 'repository',
6+
#platforms : [ #pharo ]
7+
}
8+
]
9+
}

0 commit comments

Comments
 (0)