mirror of
https://github.com/alkoleft/yaxunit-addin.git
synced 2024-11-30 08:06:40 +02:00
Переименовал + сборка пакета
This commit is contained in:
parent
91a400ad61
commit
441fed08d0
49
.github/workflows/build.yml
vendored
49
.github/workflows/build.yml
vendored
@ -5,7 +5,7 @@ on:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build-win:
|
||||
build-win-x86:
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
@ -28,9 +28,9 @@ jobs:
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: windows-x86
|
||||
path: ${{github.workspace}}/build/Release/
|
||||
path: ${{github.workspace}}/build/Release/*AddIn.dll
|
||||
|
||||
build-win-64:
|
||||
build-win-x64:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@ -52,10 +52,9 @@ jobs:
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: windows-x64
|
||||
path: ${{github.workspace}}/build/Release/
|
||||
path: ${{github.workspace}}/build/Release/*AddIn.dll
|
||||
|
||||
|
||||
build-lin:
|
||||
build-lin-x64:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
@ -73,13 +72,45 @@ jobs:
|
||||
|
||||
- name: Configure CMake
|
||||
run: cmake -B ${{github.workspace}}/build -GNinja
|
||||
-DCMAKE_CXX_COMPILER=g++-11
|
||||
-DCMAKE_C_COMPILER=gcc-11
|
||||
-DCMAKE_CXX_COMPILER=g++-10
|
||||
-DCMAKE_C_COMPILER=gcc-10
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
#-DCMAKE_CXX_STANDARD=${{matrix.cxx_standard}}
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/build --parallel
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: linux-x64
|
||||
path: ${{github.workspace}}/build/*AddIn.so
|
||||
|
||||
build-package:
|
||||
needs: [build-win-x86, build-win-x64, build-lin-x64]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Download linux-x64
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: linux-x64
|
||||
path: linux-x64
|
||||
- name: Download windows-x86
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: windows-x86
|
||||
path: windows-x86
|
||||
- name: Download windows-x64
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: windows-x64
|
||||
path: windows-x64
|
||||
- name: Build bundle
|
||||
run: |
|
||||
mv ./linux-x64/YaxUnitAddIn.so ./bundle/YaxUnitAddIn-x64.so
|
||||
mv ./windows-x86/YaxUnitAddIn.dll ./bundle/YaxUnitAddIn-x86.dll
|
||||
mv ./windows-x64/YaxUnitAddIn.dll ./bundle/YaxUnitAddIn-x64.dll
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: bundle
|
||||
path: ${{github.workspace}}/bundle/*
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
build/
|
||||
Builds/
|
||||
|
@ -1,8 +1,8 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(SampleAddIn)
|
||||
project(YaxUnitAddIn)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(TARGET SampleAddIn)
|
||||
set(TARGET YaxUnitAddIn)
|
||||
set(CMAKE_SHARED_LIBRARY_PREFIX "")
|
||||
|
||||
option(CASE_INSENSITIVE "Case insensitive method names" OFF)
|
||||
@ -16,8 +16,8 @@ list(APPEND SOURCES
|
||||
src/exports.cpp
|
||||
src/Component.cpp
|
||||
src/Component.h
|
||||
src/SampleAddIn.cpp
|
||||
src/SampleAddIn.h)
|
||||
src/YaxUnitAddIn.cpp
|
||||
src/YaxUnitAddIn.h)
|
||||
|
||||
if (ANDROID)
|
||||
list(APPEND SOURCES
|
||||
|
@ -1,4 +1,4 @@
|
||||
[![Build status](https://ci.appveyor.com/api/projects/status/uf3bq0j5xgdn3t2a/branch/master?svg=true)](https://ci.appveyor.com/project/alkoleft/yaxunit-addin/branch/master)
|
||||
[![Build status](https://github.com/alkoleft/yaxunit-addin/actions/workflows/build.yml/badge.svg)](https://github.com/alkoleft/yaxunit-addin/actions/workflows/build.yml)
|
||||
|
||||
# YaxUnit-Addin
|
||||
|
||||
|
10
appveyor.yml
10
appveyor.yml
@ -35,10 +35,6 @@ install:
|
||||
build:
|
||||
verbosity: minimal
|
||||
|
||||
after_build:
|
||||
- ps: Push-AppveyorArtifact Builds/Release/SampleAddIn.dll -DeploymentName binaries -FileName SampleAddIn.dll
|
||||
- sh: appveyor PushArtifact SampleAddIn.so -DeploymentName binaries -FileName SampleAddIn.so
|
||||
|
||||
for:
|
||||
- matrix:
|
||||
only:
|
||||
@ -47,7 +43,7 @@ for:
|
||||
- mkdir Builds/Release -p && cd ./Builds/Release
|
||||
- cmake -DCMAKE_BUILD_TYPE=Release ../../; cmake --build .
|
||||
after_build:
|
||||
- sh: appveyor PushArtifact SampleAddIn.so -DeploymentName binaries -FileName SampleAddIn.so
|
||||
- sh: appveyor PushArtifact YaxUnitAddIn.so -DeploymentName binaries -FileName YaxUnitAddIn.so
|
||||
|
||||
- matrix:
|
||||
only:
|
||||
@ -55,7 +51,7 @@ for:
|
||||
before_build:
|
||||
- ps: cmake -B Builds -G "Visual Studio 17 2022" -A Win32
|
||||
after_build:
|
||||
- ps: Push-AppveyorArtifact Builds/Release/SampleAddIn.dll -DeploymentName binaries -FileName SampleAddIn-x86.dll
|
||||
- ps: Push-AppveyorArtifact Builds/Release/YaxUnitAddIn.dll -DeploymentName binaries -FileName YaxUnitAddIn-x86.dll
|
||||
|
||||
- matrix:
|
||||
only:
|
||||
@ -63,7 +59,7 @@ for:
|
||||
before_build:
|
||||
- ps: cmake -B Builds -G "Visual Studio 17 2022" -A x64
|
||||
after_build:
|
||||
- ps: Push-AppveyorArtifact Builds/Release/SampleAddIn.dll -DeploymentName binaries -FileName SampleAddIn-x64.dll
|
||||
- ps: Push-AppveyorArtifact Builds/Release/YaxUnitAddIn.dll -DeploymentName binaries -FileName YaxUnitAddIn-x64.dll
|
||||
|
||||
- matrix:
|
||||
only:
|
||||
|
6
bundle/MANIFEST.XML
Normal file
6
bundle/MANIFEST.XML
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<bundle xmlns="http://v8.1c.ru/8.2/addin/bundle" name="YaxUnitAddIn">
|
||||
<component os="Windows" path="YaxUnitAddIn-x86.dll" type="native" arch="i386" />
|
||||
<component os="Windows" path="YaxUnitAddIn-x64.dll" type="native" arch="x86_64" />
|
||||
<component os="Linux" path="YaxUnitAddIn-x64.so" type="native" arch="x86_64" />
|
||||
</bundle>
|
@ -24,13 +24,13 @@
|
||||
#include <string>
|
||||
#include <thread>
|
||||
|
||||
#include "SampleAddIn.h"
|
||||
#include "YaxUnitAddIn.h"
|
||||
|
||||
std::string SampleAddIn::extensionName() {
|
||||
std::string YaxUnitAddIn::extensionName() {
|
||||
return "Sleep";
|
||||
}
|
||||
|
||||
SampleAddIn::SampleAddIn() {
|
||||
YaxUnitAddIn::YaxUnitAddIn() {
|
||||
|
||||
// Full featured property registration example
|
||||
AddProperty(L"Version", L"ВерсияКомпоненты", [&]() {
|
||||
@ -38,11 +38,11 @@ SampleAddIn::SampleAddIn() {
|
||||
return std::make_shared<variant_t>(std::move(s));
|
||||
});
|
||||
|
||||
AddMethod(L"Sleep", L"Ожидать", this, &SampleAddIn::sleep, {{0, 5}});
|
||||
AddMethod(L"Sleep", L"Ожидать", this, &YaxUnitAddIn::sleep, {{0, 5}});
|
||||
}
|
||||
|
||||
|
||||
void SampleAddIn::sleep(const variant_t &delay) {
|
||||
void YaxUnitAddIn::sleep(const variant_t &delay) {
|
||||
using namespace std;
|
||||
// It safe to get any type from variant.
|
||||
// Exceptions are handled by component API.
|
@ -17,16 +17,16 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SAMPLEADDIN_H
|
||||
#define SAMPLEADDIN_H
|
||||
#ifndef YAXUNITADDIN_H
|
||||
#define YAXUNITADDIN_H
|
||||
|
||||
#include "Component.h"
|
||||
|
||||
class SampleAddIn final : public Component {
|
||||
class YaxUnitAddIn final : public Component {
|
||||
public:
|
||||
const char *Version = u8"1.0.0";
|
||||
|
||||
SampleAddIn();
|
||||
YaxUnitAddIn();
|
||||
|
||||
private:
|
||||
std::string extensionName() override;
|
||||
@ -34,4 +34,4 @@ private:
|
||||
void sleep(const variant_t &delay);
|
||||
};
|
||||
|
||||
#endif //SAMPLEADDIN_H
|
||||
#endif //YAXUNITADDIN_H
|
@ -1,4 +1,4 @@
|
||||
LIBRARY "SampleAddIn"
|
||||
LIBRARY "YaxUnitAddIn"
|
||||
|
||||
EXPORTS
|
||||
GetClassObject
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <ComponentBase.h>
|
||||
#include <types.h>
|
||||
|
||||
#include "SampleAddIn.h"
|
||||
#include "YaxUnitAddIn.h"
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#pragma warning (disable : 4311 4302)
|
||||
@ -36,7 +36,7 @@ long GetClassObject(const WCHAR_T *clsName, IComponentBase **pInterface) {
|
||||
if (!*pInterface) {
|
||||
auto cls_name = std::u16string(reinterpret_cast<const char16_t *>(clsName));
|
||||
if (cls_name == u"Sleep") {
|
||||
*pInterface = new SampleAddIn;
|
||||
*pInterface = new YaxUnitAddIn;
|
||||
}
|
||||
return (long) *pInterface;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user