Skip to content

Commit baec2ed

Browse files
authored
Merge pull request #1 from EvilBeaver/develop
Слияние с последними изменениями
2 parents 4786b60 + 52ff6ea commit baec2ed

File tree

255 files changed

+12343
-10170
lines changed

Some content is hidden

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

255 files changed

+12343
-10170
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,8 @@ src/ScriptEngine.Snegopat/Snegopat_h.h
5555
# Песональный вспомагательный скрипт
5656
build.user.bat
5757
src/packages/
58+
src/DebugServer/node_modules/
59+
# Visual Studio OpenCover and Test result
60+
src/OpenCover
61+
TestResult.xml
62+
tests/component/Component.dll

BuildAll.csproj

Lines changed: 214 additions & 179 deletions
Large diffs are not rendered by default.

Jenkinsfile

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
2+
pipeline {
3+
4+
agent none
5+
6+
environment {
7+
ReleaseNumber = 18
8+
outputEnc = '65001'
9+
}
10+
11+
stages {
12+
stage('Windows Build') {
13+
agent { label 'windows' }
14+
15+
// пути к инструментам доступны только когда
16+
// нода уже определена
17+
environment {
18+
NugetPath = "${tool 'nuget'}"
19+
OneScriptDocumenter = "${tool 'documenter'}"
20+
}
21+
22+
steps {
23+
24+
// в среде Multibranch Pipeline Jenkins первращает имена веток в папки
25+
// а для веток Gitflow вида release/* экранирует в слэш в %2F
26+
// При этом MSBuild, видя urlEncoding, разэкранирует его обратно, ломая путь (появляется слэш, где не надо)
27+
//
28+
// Поэтому, применяем костыль с кастомным workspace
29+
// см. https://issues.jenkins-ci.org/browse/JENKINS-34564
30+
31+
ws("$workspace".replaceAll("%", "_"))
32+
{
33+
checkout scm
34+
35+
bat 'set'
36+
bat "chcp $outputEnc > nul\r\n\"${tool 'MSBuild'}\" BuildAll.csproj /p:Configuration=Release /p:Platform=x86 /t:Build"
37+
38+
stash includes: 'tests, install/build/**, mddoc/**', name: 'buildResults'
39+
}
40+
}
41+
42+
}
43+
44+
stage('VSCode debugger Build') {
45+
agent {
46+
docker {
47+
image 'node'
48+
label 'linux'
49+
}
50+
}
51+
52+
steps {
53+
unstash 'buildResults'
54+
sh 'npm install vsce'
55+
script {
56+
def vsceBin = pwd() + "/node_modules/.bin/vsce"
57+
sh "cd install/build/vscode && ${vsceBin} package"
58+
archiveArtifacts artifacts: 'install/build/vscode/*.vsix', fingerprint: true
59+
stash includes: 'install/build/vscode/*.vsix', name: 'vsix'
60+
}
61+
}
62+
}
63+
64+
stage('Windows testing') {
65+
agent { label 'windows' }
66+
67+
steps {
68+
ws("$workspace".replaceAll("%", "_"))
69+
{
70+
dir('install/build'){
71+
deleteDir()
72+
}
73+
unstash 'buildResults'
74+
bat "chcp $outputEnc > nul\r\n\"${tool 'MSBuild'}\" BuildAll.csproj /p:Configuration=Release /p:Platform=x86 /t:xUnitTest"
75+
76+
junit 'tests/tests.xml'
77+
}
78+
}
79+
}
80+
81+
stage('Linux testing') {
82+
83+
agent { label 'master' }
84+
85+
steps {
86+
87+
dir('install/build'){
88+
deleteDir()
89+
}
90+
91+
unstash 'buildResults'
92+
93+
sh '''\
94+
if [ ! -d lintests ]; then
95+
mkdir lintests
96+
fi
97+
98+
rm lintests/*.xml -f
99+
cd tests
100+
mono ../install/build/bin/oscript.exe testrunner.os -runall . xddReportPath ../lintests || true
101+
exit 0
102+
'''.stripIndent()
103+
104+
junit 'lintests/*.xml'
105+
archiveArtifacts artifacts: 'lintests/*.xml', fingerprint: true
106+
}
107+
108+
109+
110+
}
111+
112+
stage('Packaging') {
113+
agent { label 'windows' }
114+
115+
environment {
116+
NugetPath = "${tool 'nuget'}"
117+
InnoSetupPath = "${tool 'InnoSetup'}"
118+
}
119+
120+
steps {
121+
ws("$workspace".replaceAll("%", "_"))
122+
{
123+
dir('install/build'){
124+
deleteDir()
125+
}
126+
unstash 'buildResults'
127+
//unstash 'sitedoc'
128+
bat "chcp $outputEnc > nul\r\n\"${tool 'MSBuild'}\" BuildAll.csproj /p:Configuration=Release /p:Platform=x86 /t:CreateZip;CreateInstall;CreateNuget"
129+
archiveArtifacts artifacts: '**/dist/*.exe, **/dist/*.msi, **/dist/*.zip, **/dist/*.nupkg', fingerprint: true
130+
stash includes: 'dist/*.exe, **/dist/*.msi, **/dist/*.zip', name: 'winDist'
131+
}
132+
}
133+
}
134+
135+
stage ('Packaging DEB and RPM') {
136+
agent { label 'master' }
137+
138+
steps {
139+
140+
dir('install/build'){
141+
deleteDir()
142+
}
143+
checkout scm
144+
unstash 'buildResults'
145+
146+
sh '''
147+
cd install
148+
chmod +x prepare-build.sh
149+
chmod +x deb-build.sh
150+
chmod +x rpm-build.sh
151+
152+
sh ./prepare-build.sh
153+
154+
DISTPATH=`pwd`/build
155+
156+
sh ./deb-build.sh $DISTPATH
157+
sh ./rpm-build.sh $DISTPATH
158+
'''.stripIndent()
159+
160+
archiveArtifacts artifacts: 'output/*', fingerprint: true
161+
stash includes: 'output/*', name: 'linDist'
162+
163+
}
164+
165+
}
166+
167+
stage ('Publishing night-build') {
168+
when { branch 'develop' }
169+
agent { label 'master' }
170+
171+
steps {
172+
unstash 'winDist'
173+
unstash 'linDist'
174+
unstash 'vsix'
175+
176+
sh '''
177+
TARGET="/var/www/oscript.io/download/versions/night-build/"
178+
sudo rsync -rv --delete --exclude mddoc*.zip dist/* $TARGET
179+
sudo rsync -rv --delete --exclude *.src.rpm output/* $TARGET
180+
sudo rsync -rv --delete install/build/vscode/*.vsix $TARGET
181+
182+
'''.stripIndent()
183+
}
184+
}
185+
186+
}
187+
188+
}

Makefile

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
SOLUTION_FILE=src/1Script_Mono.sln
2+
PLATFORM="Any CPU"
3+
CONFIGURATION=Release
4+
SOURCEBINDIR=src/oscript/bin/${CONFIGURATION}
5+
BIN_OUTPUTDIR=dist/bin
6+
LIB_OUTPUTDIR=dist/lib
7+
OSCRIPTEXE=${BIN_OUTPUTDIR}/oscript.exe
8+
OPMOS=${LIB_OUTPUTDIR}/opm/opm.os
9+
OPM="${OSCRIPTEXE} ${OPMOS}"
10+
PREFIX=/usr
11+
12+
all: dist
13+
14+
dist: ${OSCRIPTEXE} lib
15+
16+
lib: ${OSCRIPTEXE}
17+
test -d ${LIB_OUTPUTDIR} || mkdir -p ${LIB_OUTPUTDIR}
18+
cp -r oscript-library/src/* ${LIB_OUTPUTDIR}
19+
20+
NUGET:
21+
nuget restore ${SOLUTION_FILE}
22+
23+
${OSCRIPTEXE}: NUGET
24+
msbuild /p:Platform=${PLATFORM} /p:Configuration=${CONFIGURATION} ${SOLUTION_FILE}
25+
test -d ${BIN_OUTPUTDIR} || mkdir -p ${BIN_OUTPUTDIR}
26+
cp ${SOURCEBINDIR}/*.dll ${BIN_OUTPUTDIR}
27+
cp ${SOURCEBINDIR}/*.exe ${BIN_OUTPUTDIR}
28+
cp ${SOURCEBINDIR}/*.cfg ${BIN_OUTPUTDIR}
29+
30+
clean:
31+
rm -rf ${BIN_OUTPUTDIR}
32+
rm -rf ${LIB_OUTPUTDIR}
33+
34+
${OPMOS}:
35+
36+
install: install_bin install_lib
37+
38+
install_bin:
39+
mkdir -p ${PREFIX}/share/oscript/bin
40+
cp ${BIN_OUTPUTDIR}/* ${PREFIX}/share/oscript/bin
41+
cp install/builders/deb/oscript ${PREFIX}/bin/oscript
42+
cp install/builders/deb/oscript-cgi ${PREFIX}/bin/oscript-cgi
43+
44+
install_lib:
45+
mkdir -p ${PREFIX}/share/oscript/lib
46+
cp -r ${LIB_OUTPUTDIR}/* ${PREFIX}/share/oscript/lib
47+
cp install/builders/deb/oscript-opm ${PREFIX}/bin/oscript-opm
48+
ln -s ${PREFIX}/bin/oscript-opm ${PREFIX}/bin/opm
49+
50+
uninstall: uninstall_lib uninstall_bin
51+
52+
uninstall_bin:
53+
rm -rf ${PREFIX}/share/oscript/bin
54+
rm ${PREFIX}/bin/oscript
55+
rm ${PREFIX}/bin/oscript-cgi
56+
57+
uninstall_lib:
58+
rm ${PREFIX}/bin/opm
59+
rm ${PREFIX}/bin/oscript-opm
60+
rm -rf ${PREFIX}/share/oscript/lib
61+
62+
.PHONY: all install uninstall dist lib clean

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# README #
2-
3-
[![Join the chat at https://gitter.im/EvilBeaver/OneScript](https://badges.gitter.im/EvilBeaver/OneScript.svg)](https://gitter.im/EvilBeaver/OneScript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
2+
3+
[![Join the chat at https://gitter.im/EvilBeaver/OneScript](https://badges.gitter.im/EvilBeaver/OneScript.svg)](https://gitter.im/EvilBeaver/OneScript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
44

55
### Проект является независимой кросс-платформенной реализацией виртуальной машины, исполняющей скрипты на языке 1С:Предприятие.
66

@@ -22,4 +22,4 @@ http://oscript.io
2222

2323
## Библиотека полезных скриптов
2424

25-
В поставку OneScript уже входит набор наиболее часто используемых пакетов. Эти пакеты разрабатываются в едином репозитарии на github и доступны для всем желающим.
25+
В поставку OneScript уже входит набор наиболее часто используемых пакетов. Эти пакеты разрабатываются в едином репозитарии на github https://github.com/oscript-library и доступны для всем желающим.

appveyor.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
version: 1.0.17-alpha{build}
1+
image: Visual Studio 2017
2+
version: 1.0.18-alpha{build}
23
pull_requests:
34
do_not_increment_build_number: true
45
configuration: Release

codecov.io.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
echo "dont forget pip install codecov"
2+
echo "and dont forget set CODECOV_TOKEN"
3+
4+
codecov -f $(pwd)/src/OpenCover/opencover.xml

cover.bat

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
echo "Run testrunner.os behind NUnit with OpenCover"
2+
echo "generate OpneCover.xml to external services like Coverals.io"
3+
echo "Create local report for contributor ;-)"
4+
5+
"%CD%\src\packages\OpenCover.4.6.519\tools\OpenCover.Console.exe" -output:"%CD%\src\OpenCover\opencover.xml" -target:./src/packages/NUnit.ConsoleRunner.3.5.0/tools/nunit3-console.exe -targetargs:"./src/NUnitTests/bin/Release/NUnitTests.dll" -register:user
6+
7+
"%CD%\src\packages\ReportGenerator.2.5.1\tools\ReportGenerator.exe" -reports:"%CD%\src\OpenCover\opencover.xml" -targetdir:"%CD%\src\OpenCover\CodeCovLocal"

coverals.io.bat

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
echo "Publish coverals io info"
2+
echo "dont forget set secure repo token ;-) COVERALLS_REPO_TOKEN"
3+
echo "dont forget use branch and pull request params"
4+
5+
"%CD%\src\packages\coveralls.net.0.7.0\tools\csmacnz.Coveralls.exe" --useRelativePaths --opencover -i %CD%\src\OpenCover\opencover.xml

install/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
# ./build.sh /p:Platform="x86" to build for x86
55

66
cd `dirname $0`
7-
xbuild /p:Platform="Any CPU" /p:Configuration="Release" $@ ../src/1Script_Mono.sln
7+
msbuild /p:Platform="Any CPU" /p:Configuration="Release" $@ ../src/1Script_Mono.sln
88

install/builders/deb/Dockerfile

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
1-
FROM ubuntu:latest
1+
FROM ubuntu:16.04
22

33

44
MAINTAINER sergey.batanov@dmpas.ru
55

6-
# чтобы запустить тесты
7-
RUN locale-gen --lang ru_RU.UTF-8
8-
ENV LANG ru_RU.UTF-8
9-
106
# Add mono repository
11-
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \
12-
echo "deb http://download.mono-project.com/repo/debian wheezy main" > /etc/apt/sources.list.d/mono-xamarin.list
7+
#RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \
8+
# echo "deb http://download.mono-project.com/repo/debian wheezy main" > /etc/apt/sources.list.d/mono-xamarin.list
139

1410
RUN apt-get update && apt-get install -y \
1511
# runtime dependencies
16-
mono-runtime \
17-
libmono-system-core4.0-cil \
18-
libmono-system4.0-cil \
19-
libmono-corlib4.0-cil \
20-
libmono-i18n4.0-all \
12+
# mono-runtime \
13+
# libmono-system-core4.0-cil \
14+
# libmono-system4.0-cil \
15+
# libmono-corlib4.0-cil \
16+
# libmono-i18n4.0-all \
2117
# deb-package tools
2218
dpkg\
2319
debconf\
2420
debhelper\
2521
lintian\
2622
md5deep\
27-
fakeroot
23+
fakeroot \
24+
locales
25+
26+
# чтобы запустить тесты
27+
RUN locale-gen --lang ru_RU.UTF-8
28+
ENV LANG ru_RU.UTF-8
29+
30+
COPY ./ /opt/deb/
2831

29-
ADD ./build.sh /root/
30-
ENTRYPOINT /root/build.sh
32+
ENTRYPOINT /opt/deb/build.sh
3133

install/builders/deb/build.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
#!/bin/sh
22

3-
SRCPATH=/media
3+
DATAROOT=/media
4+
SRCPATH=${DATAROOT}/src
45
BINPATH=${SRCPATH}/bin/
5-
DEBBUILDROOT=${SRCPATH}/bin/
6-
BUILDERROOT=${SRCPATH}/deb/
6+
DEBBUILDROOT=${DATAROOT}/deb/
7+
BUILDERROOT=/opt/deb/
78

8-
VERSION=$(cat ${BINPATH}VERSION)
9+
if [ -d "$DEBBUILDROOT" ]; then
10+
rm -rf $DEBBUILDROOT
11+
mkdir $DEBBUILDROOT
12+
fi
13+
14+
VERSION=$(cat ${DATAROOT}/VERSION)
915
PAKNAME=onescript-engine
1016
DSTPATH=${DEBBUILDROOT}${PAKNAME}
1117

@@ -15,6 +21,7 @@ mkdir -p $DSTPATH/usr/bin
1521
mkdir -p $DSTPATH/usr/share/oscript/lib
1622
mkdir -p $DSTPATH/usr/share/oscript/bin
1723
mkdir -p $DSTPATH/etc
24+
mkdir -p $DSTPATH/etc/bash_completion.d
1825

1926
cp ${BUILDERROOT}settings/dirs $DSTPATH/DEBIAN/
2027
cat ${BUILDERROOT}settings/control | sed -r "s/VERSION/$VERSION/g" > $DSTPATH/DEBIAN/control
@@ -23,6 +30,7 @@ cp ${BINPATH}*.dll $DSTPATH/usr/share/oscript/bin
2330
cp ${BUILDERROOT}oscript $DSTPATH/usr/bin
2431
cp ${BUILDERROOT}oscript-cgi $DSTPATH/usr/bin
2532
cp ${BUILDERROOT}oscript-opm $DSTPATH/usr/bin
33+
cp ${BUILDERROOT}oscript-opm-completion $DSTPATH/etc/bash_completion.d
2634
cp -r ${SRCPATH}/lib/* $DSTPATH/usr/share/oscript/lib
2735
cp ${BINPATH}/oscript.cfg $DSTPATH/etc
2836

0 commit comments

Comments
 (0)