Skip to content

Commit

Permalink
Merge branch 'release/v1.0.19'
Browse files Browse the repository at this point in the history
  • Loading branch information
EvilBeaver committed Dec 27, 2017
2 parents 4bb6729 + a3ac50b commit d9cb45b
Show file tree
Hide file tree
Showing 183 changed files with 10,749 additions and 1,505 deletions.
4 changes: 0 additions & 4 deletions .gitmodules

This file was deleted.

71 changes: 48 additions & 23 deletions BuildAll.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<BinFolder>$(OutputPathForBuild)\bin\</BinFolder>
<LibFolder>$(OutputPathForBuild)\lib\</LibFolder>
<DocFolder>$(OutputPathForBuild)\doc\</DocFolder>
<DebugDest>$(OutputPathForBuild)\vscode\</DebugDest>
<DebugDest>$(OutputPathForBuild)\vscode\</DebugDest>
<MDDocFolder>$(MSBuildProjectDirectory)\mddoc</MDDocFolder>
<ExamplesFolder>$(OutputPathForBuild)\examples\</ExamplesFolder>
<Solution>$(MSBuildProjectDirectory)\src\1Script.sln</Solution>
Expand Down Expand Up @@ -104,27 +104,32 @@
<Target Name="PreparePackage">

<!--Сборка документации-->
<CallTarget Targets="GenerateDocs"/>

<CallTarget Targets="GenerateDocs" Condition="'$(OneScriptDocumenter)' != ''"/>

<!--Сборка библиотеки-->
<CallTarget Targets="CreateLibrary"/>

<CreateItem Include="$(OutputPathForBuild)\*.pdb;$(OutputPathForBuild)\*.XML;$(OutputPathForBuild)\StandaloneRunner.exe">
<Output TaskParameter="Include" ItemName="RemoveUnnessesaryFiles" />
</CreateItem>

<Delete Files="@(RemoveUnnessesaryFiles)" />

<MakeDir Directories="@(DebugDist)"/>

<ItemGroup>
<DbgFiles Include="$(OutputPathForBuild)\DebugServer.exe"/>
<DbgFiles Include="$(OutputPathForBuild)\DebugServer.exe.config"/>
<DbgFiles Include="$(OutputPathForBuild)\OneScript.DebugProtocol.dll"/>
<DbgFiles Include="$(OutputPathForBuild)\Newtonsoft.Json.dll"/>
</ItemGroup>

<Copy SourceFiles="@(DbgFiles)" DestinationFolder="$(DebugDest)\bin"/>
<Move SourceFiles="$(OutputPathForBuild)\package.json" DestinationFolder="$(DebugDest)"/>
<Move SourceFiles="$(OutputPathForBuild)\images\mono-debug-icon.png" DestinationFolder="$(DebugDest)\images"/>

<MakeDir Directories="@(DebugDist)"/>

<ItemGroup>
<DbgFiles Include="$(OutputPathForBuild)\DebugServer.exe"/>
<DbgFiles Include="$(OutputPathForBuild)\DebugServer.exe.config"/>
<DbgFiles Include="$(OutputPathForBuild)\OneScript.DebugProtocol.dll"/>
<DbgFiles Include="$(OutputPathForBuild)\Newtonsoft.Json.dll"/>
</ItemGroup>

<Copy SourceFiles="@(DbgFiles)" DestinationFolder="$(DebugDest)\bin"/>
<Move SourceFiles="$(OutputPathForBuild)\README.md" DestinationFolder="$(DebugDest)"/>
<Move SourceFiles="$(OutputPathForBuild)\package.json" DestinationFolder="$(DebugDest)"/>
<Move SourceFiles="$(OutputPathForBuild)\images\mono-debug-icon.png" DestinationFolder="$(DebugDest)\images"/>
<RemoveDir Directories="$(OutputPathForBuild)\images"/>

<ItemGroup>

<BinaryFiles Include="$(OutputPathForBuild)\oscript.exe"/>
Expand All @@ -136,28 +141,48 @@
<BinaryFiles Include="$(OutputPathForBuild)\Newtonsoft.Json.dll"/>
<BinaryFiles Include="$(OutputPathForBuild)\ICSharpCode.AvalonEdit.dll"/>
<BinaryFiles Include="$(OutputPathForBuild)\oscript.cfg"/>
<BinaryFiles Include="$(OutputPathForBuild)\ASPNETHandler.dll"/>

<LibraryFiles Include="$(MSBuildProjectDirectory)\oscript-library\src\**\*" Exclude="$(MSBuildProjectDirectory)\oscript-library\**\*.git"/>
<ExampleFiles Include="$(MSBuildProjectDirectory)\install\examples\**\*"/>

</ItemGroup>

<Move SourceFiles="@(BinaryFiles)" DestinationFolder="$(BinFolder)"/>
<Copy SourceFiles="@(LibraryFiles)" DestinationFolder="$(LibFolder)\%(RecursiveDir)"/>
<Copy SourceFiles="@(ExampleFiles)" DestinationFolder="$(ExamplesFolder)\%(RecursiveDir)"/>

<!-- Удаление артефактов NUnit -->
<ItemGroup>
<NUnitArtifacts Include="$(OutputPathForBuild)\*.dll"/>
<NUnitArtifacts Include="$(OutputPathForBuild)\ru\*.dll"/>
<UnwantedArtifacts Include="$(OutputPathForBuild)\*.dll"/>
<UnwantedArtifacts Include="$(OutputPathForBuild)\ru\*.dll"/>
<UnwantedArtifacts Include="$(OutputPathForBuild)\roslyn\*.*"/>
</ItemGroup>
<Delete Files="@(DbgFiles)"/>
<Delete Files="@(NUnitArtifacts)"/>
<RemoveDir Directories="$(OutputPathForBuild)\ru"/>

<Delete Files="@(UnwantedArtifacts)"/>
<RemoveDir Directories="$(OutputPathForBuild)\ru"/>
<!-- Копирование скрипта запуска для opm -->
<Copy SourceFiles="$(MSBuildProjectDirectory)\install\opm.bat" DestinationFolder="$(BinFolder)"/>

<CallTarget Targets="InstallStdlib" Condition="'$(StandardLibraryPacks)' != ''"/>

</Target>

<Target Name="CreateLibrary" DependsOnTargets="Compile">

<MakeDir Directories="@(LibFolder)"/>

<Exec Command="&quot;$(OutputPathForBuild)oscript.exe&quot; &quot;$(MSBuildProjectDirectory)\install\unicode-zipper.os&quot; unpack &quot;$(MSBuildProjectDirectory)\install\opm-0.13.0.ospx&quot; &quot;$(LibFolder)\tmp&quot;"/>
<Exec Command="&quot;$(OutputPathForBuild)oscript.exe&quot; &quot;$(MSBuildProjectDirectory)\install\unicode-zipper.os&quot; unpack &quot;$(LibFolder)\tmp\content.zip&quot; &quot;$(LibFolder)/opm&quot;"/>
<Copy SourceFiles="$(MSBuildProjectDirectory)\install\package-loader.os" DestinationFolder="$(LibFolder)"/>
<DeleteTree Directories="$(LibFolder)\tmp"/>

</Target>

<Target Name="InstallStdlib">
<ItemGroup>
<LibraryFiles Include="$(StandardLibraryPacks)\**\*" />
</ItemGroup>
<Copy SourceFiles="@(LibraryFiles)" DestinationFolder="$(LibFolder)\%(RecursiveDir)"/>
</Target>

<Target Name="CreateInstall" DependsOnTargets="PrepareDistOutputFolder">
Expand Down
114 changes: 86 additions & 28 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pipeline {
agent none

environment {
ReleaseNumber = 18
ReleaseNumber = 19
outputEnc = '65001'
}

Expand All @@ -17,6 +17,7 @@ pipeline {
environment {
NugetPath = "${tool 'nuget'}"
OneScriptDocumenter = "${tool 'documenter'}"
StandardLibraryPacks = "${tool 'os_stdlib'}"
}

steps {
Expand All @@ -27,14 +28,56 @@ pipeline {
//
// Поэтому, применяем костыль с кастомным workspace
// см. https://issues.jenkins-ci.org/browse/JENKINS-34564
//
// А еще Jenkins под Windows постоянно добавляет в конец папки какую-то мусорную строку.
// Для этого отсекаем все, что находится после последнего дефиса
// см. https://issues.jenkins-ci.org/browse/JENKINS-40072

ws("$workspace".replaceAll("%", "_"))
ws(env.WORKSPACE.replaceAll("%", "_").replaceAll(/(-[^-]+$)/, ""))
{
checkout scm
step([$class: 'WsCleanup'])
checkout scm

bat 'set'
bat "chcp $outputEnc > nul\r\n\"${tool 'MSBuild'}\" BuildAll.csproj /p:Configuration=Release /p:Platform=x86 /t:Build"

withSonarQubeEnv('silverbulleters') {
script {
def sqScannerMsBuildHome = tool 'sonar-scanner for msbuild';
sqScannerMsBuildHome = sqScannerMsBuildHome + "\\SonarQube.Scanner.MSBuild.exe";
def sonarcommandStart = "@" + sqScannerMsBuildHome + " begin /k:1script /n:OneScript /v:\"1.0.${env.ReleaseNumber}\"";
def makeAnalyzis = true
if (env.BRANCH_NAME == "develop") {
echo 'Analysing develop branch'
} else if (env.BRANCH_NAME.startsWith("PR-")) {
// Report PR issues
def PRNumber = env.BRANCH_NAME.tokenize("PR-")[0]
def gitURLcommand = 'git config --local remote.origin.url'
def gitURL = ""

if (isUnix()) {
gitURL = sh(returnStdout: true, script: gitURLcommand).trim()
} else {
gitURL = bat(returnStdout: true, script: gitURLcommand).trim()
}

def repository = gitURL.tokenize("/")[2] + "/" + gitURL.tokenize("/")[3]
repository = repository.tokenize(".")[0]
withCredentials([string(credentialsId: 'GithubOAUTHToken_ForSonar', variable: 'githubOAuth')]) {
sonarcommandStart = sonarcommandStart + " /d:sonar.analysis.mode=issues /d:sonar.github.pullRequest=${PRNumber} /d:sonar.github.repository=${repository} /d:sonar.github.oauth=${githubOAuth}"
}
} else {
makeAnalyzis = false
}

if (makeAnalyzis) {
bat "${sonarcommandStart}"
}
bat "chcp $outputEnc > nul\r\n\"${tool 'MSBuild'}\" BuildAll.csproj /p:Configuration=Release /p:Platform=x86 /t:Build"
if (makeAnalyzis) {
bat "${sqScannerMsBuildHome} end"
}
}
}

stash includes: 'tests, install/build/**, mddoc/**', name: 'buildResults'
}
}
Expand Down Expand Up @@ -65,12 +108,12 @@ pipeline {
agent { label 'windows' }

steps {
ws("$workspace".replaceAll("%", "_"))
ws(env.WORKSPACE.replaceAll("%", "_").replaceAll(/(-[^-]+$)/, ""))
{
dir('install/build'){
deleteDir()
}
unstash 'buildResults'
deleteDir()
}
unstash 'buildResults'
bat "chcp $outputEnc > nul\r\n\"${tool 'MSBuild'}\" BuildAll.csproj /p:Configuration=Release /p:Platform=x86 /t:xUnitTest"

junit 'tests/tests.xml'
Expand All @@ -84,11 +127,11 @@ pipeline {

steps {

dir('install/build'){
deleteDir()
}
unstash 'buildResults'
dir('install/build'){
deleteDir()
}
unstash 'buildResults'

sh '''\
if [ ! -d lintests ]; then
Expand Down Expand Up @@ -118,12 +161,17 @@ pipeline {
}

steps {
ws("$workspace".replaceAll("%", "_"))
ws(env.WORKSPACE.replaceAll("%", "_").replaceAll(/(-[^-]+$)/, ""))
{
dir('install/build'){
deleteDir()
}
unstash 'buildResults'
deleteDir()
}

dir('dist'){
deleteDir()
}

unstash 'buildResults'
//unstash 'sitedoc'
bat "chcp $outputEnc > nul\r\n\"${tool 'MSBuild'}\" BuildAll.csproj /p:Configuration=Release /p:Platform=x86 /t:CreateZip;CreateInstall;CreateNuget"
archiveArtifacts artifacts: '**/dist/*.exe, **/dist/*.msi, **/dist/*.zip, **/dist/*.nupkg', fingerprint: true
Expand All @@ -138,9 +186,9 @@ pipeline {
steps {

dir('install/build'){
deleteDir()
}
checkout scm
deleteDir()
}
checkout scm
unstash 'buildResults'

sh '''
Expand Down Expand Up @@ -174,26 +222,36 @@ pipeline {
agent { label 'master' }

steps {

unstash 'winDist'
unstash 'linDist'
unstash 'vsix'

sh '''
if [ -d "targetContent" ]; then
rm -rf targetContent
fi
mkdir targetContent
mv dist/* targetContent/
mv output/*.rpm targetContent/
mv install/build/vscode/*.vsix targetContent/
TARGET="/var/www/oscript.io/download/versions/night-build/"
sudo rsync -rv --delete --exclude mddoc*.zip dist/* $TARGET
sudo rsync -rv --delete --exclude *.src.rpm output/* $TARGET
sudo rsync -rv --delete install/build/vscode/*.vsix $TARGET
cd targetContent
sudo rsync -rv --delete --exclude mddoc*.zip --exclude *.src.rpm . $TARGET
rm -rf targetContent
'''.stripIndent()
}
}
stage ('Publishing master') {
stage ('Publishing master') {
when { branch 'master' }
agent { label 'master' }

steps {

unstash 'winDist'
unstash 'linDist'
unstash 'vsix'
Expand Down
1 change: 1 addition & 0 deletions install/builders/rpm/oscript.spec
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Source0: OneScript-%{version}.tar.gz
BuildArch: noarch
BuildRequires: wget
Requires: mono-core
Requires: mono-locale-extras

%define _empty_manifest_terminate_build 0
%define _subdir OneScript-%{version}
Expand Down
4 changes: 4 additions & 0 deletions install/install.iss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Name: "custom"; Description: "Выборочная установка"; Flags: i

[Components]
Name: "main"; Description: "Основные файлы"; Types: normal custom; Flags: fixed
Name: "isapi"; Description: "Обработчик HTTP-сервисов"; Types: normal custom;
Name: "stdlib"; Description: "Стандартная библиотека скриптов"; Types: normal custom;
Name: "testapp"; Description: "Тестовая консоль (TestApp)";
Name: "docs"; Description: "Документация по свойствам и методам (синтакс-помощник)";
Expand All @@ -47,6 +48,9 @@ Source: "build\bin\oscript.cfg"; DestDir: "{app}\bin"; Components: main; Flags:

Source: "build\examples\*"; DestDir: "{app}\examples"; Components: main

;isapi
Source: "build\bin\ASPNETHandler.dll"; DestDir: "{app}\bin"; Components: isapi;

; testapp
Source: "build\bin\TestApp.exe"; DestDir: "{app}\bin"; Components: testapp
Source: "build\bin\ICSharpCode.AvalonEdit.dll"; DestDir: "{app}\bin"; Components: testapp
Expand Down
Binary file added install/opm-0.13.0.ospx
Binary file not shown.
Loading

0 comments on commit d9cb45b

Please sign in to comment.