Add npm, maven, conan configs (excluding cache)
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
#conan create . novoline/stable
|
||||
|
||||
from conans import ConanFile, CMake, tools, MSBuild
|
||||
import yaml
|
||||
import os
|
||||
import glob
|
||||
import shutil
|
||||
import subprocess
|
||||
import csv
|
||||
from io import StringIO
|
||||
from pathlib import Path
|
||||
|
||||
class {{package_name}}Conan(ConanFile):
|
||||
license = "© Copyright 2020 | Inspired Entertainment, Inc."
|
||||
url = "https://bitbucket.ingg.com/projects/NOV/repos/multipackage_repos/browse"
|
||||
#description = "<Description of {{package_name}} here>"
|
||||
topics = ("gds", "multipackage", "novoline")
|
||||
settings = "os", "compiler", "build_type", "arch"
|
||||
pkg_folder_name = "NovoLine.MultiSystem.Base.Pkg"
|
||||
scm = {
|
||||
"type": "git",
|
||||
"url": "auto",
|
||||
"revision": "auto",
|
||||
}
|
||||
|
||||
def requirements(self):
|
||||
self.requires("gds-tool/1.0.6@novoline/stable")
|
||||
|
||||
def copy__(self, file, src, dst, fromSrc=False):
|
||||
os.makedirs(dst, exist_ok=True)
|
||||
|
||||
srcFullPath = ''
|
||||
if fromSrc:
|
||||
srcFullPath = os.path.join(self.pkg_folder_name, src, file)
|
||||
shutil.copy(srcFullPath, dst)
|
||||
else:
|
||||
srcFullPath = os.path.join(src, file)
|
||||
self.copy(file, src=src, dst=dst)
|
||||
|
||||
dstFullPath = os.path.join(dst, file)
|
||||
if not Path(dstFullPath).is_file():
|
||||
raise FileNotFoundError(f'{srcFullPath} {dst}')
|
||||
|
||||
def imports(self):
|
||||
MODULE_DIR = 'DIR/'
|
||||
DST_DIR = f'{MODULE_DIR}/bin_enc'
|
||||
|
||||
os.makedirs(os.path.dirname(MODULE_DIR), exist_ok=True)
|
||||
shutil.copy(f"{pkg_folder_name}/{MODULE_DIR}.nsi",MODULE_DIR)
|
||||
|
||||
self.copy("*", src="gds")
|
||||
|
||||
def run_command(self, command):
|
||||
data = StringIO(command)
|
||||
reader = csv.reader(data, delimiter=' ')
|
||||
args = list(reader)
|
||||
print(args)
|
||||
|
||||
ret = subprocess.run(args[0]).returncode
|
||||
if ret != 0:
|
||||
raise Exception(f"Error: {command}")
|
||||
|
||||
def build(self):
|
||||
#use single quote outside and double quotes inside
|
||||
self.run_command(f'python createGdsPackage.py --pname "{self.name}" --pver "{self.version}" --pfolder "{pkg_folder_name}" --btype "{self.settings.build_type}"')
|
||||
|
||||
def package(self):
|
||||
self.copy("*.gds", src=f"outputs")
|
||||
|
||||
def set_version(self):
|
||||
self.version = "{{version}}"
|
||||
|
||||
def set_name(self):
|
||||
self.name = "{{name}}"
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
#conan create . novoline/stable -pr release_120
|
||||
#conan create . novoline/stable -pr release_120 -o pkg-name:header_only=False
|
||||
|
||||
from conans import ConanFile, CMake, tools, MSBuild
|
||||
import yaml
|
||||
import os
|
||||
import glob
|
||||
|
||||
class {{package_name}}Conan(ConanFile):
|
||||
license = "© Copyright 2020 | Inspired Entertainment, Inc."
|
||||
url = f"https://bitbucket.ingg.com/projects/NOV/repos/{{name}}/browse"
|
||||
#description = "<Description of {{package_name}} here>"
|
||||
topics = ("plugin", "novoline")
|
||||
settings = "os", "compiler", "build_type", "arch"
|
||||
options = {"shared": [True],
|
||||
"header_only": [True, False]}
|
||||
default_options = {"shared": True,
|
||||
"header_only": True}
|
||||
generators = "visual_studio"
|
||||
scm = {
|
||||
"type": "git",
|
||||
"url": "auto",
|
||||
"revision": "auto",
|
||||
}
|
||||
|
||||
def requirements(self):
|
||||
self.requires("nl_sdk/1.0.0@novoline/stable")
|
||||
|
||||
def imports(self):
|
||||
self.copy("*")
|
||||
|
||||
def build(self):
|
||||
msbuild = MSBuild(self)
|
||||
msbuild.build(glob.glob("*.sln")[0])
|
||||
|
||||
def package_id(self):
|
||||
if self.options.header_only:
|
||||
print(f'{self.name}/{self.version} headeronly package')
|
||||
self.info.header_only()
|
||||
|
||||
def package(self):
|
||||
self.copy("*.dll", src=f"Out/{self.settings.build_type}", keep_path=False)
|
||||
|
||||
def set_version(self):
|
||||
self.version = "1.0.0"
|
||||
|
||||
def set_name(self):
|
||||
git = tools.Git(folder=self.recipe_folder)
|
||||
_remote_url = git.get_remote_url()
|
||||
self.name = os.path.splitext(os.path.basename(_remote_url))[0]
|
||||
|
||||
Reference in New Issue
Block a user