Support for deploying to Conan.
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
af2f62a278
commit
905087f7b9
16
.drone.yml
16
.drone.yml
|
@ -69,3 +69,19 @@ steps:
|
||||||
- cp /drone/src/build-release-windows/lib/libpkmnLib.so /drone/src/build-release-windows/bin/
|
- cp /drone/src/build-release-windows/lib/libpkmnLib.so /drone/src/build-release-windows/bin/
|
||||||
- export WINEARCH=win64
|
- export WINEARCH=win64
|
||||||
- wine build-release-windows/bin/pkmnLibTests.exe -s
|
- wine build-release-windows/bin/pkmnLibTests.exe -s
|
||||||
|
- name: conan-deploy
|
||||||
|
image: deukhoofd/linux64builder
|
||||||
|
environment:
|
||||||
|
CONAN_LOGIN_USERNAME:
|
||||||
|
from_secret: conan_username
|
||||||
|
CONAN_PASSWORD:
|
||||||
|
from_secret: conan_password
|
||||||
|
commands:
|
||||||
|
- rm -rf build-debug
|
||||||
|
- rm -rf build-release-windows
|
||||||
|
- cmake -DCMAKE_BUILD_TYPE=Release . -B build-conan -D CMAKE_C_COMPILER=/usr/bin/clang -D CMAKE_CXX_COMPILER=clang++ -DWINDOWS=0
|
||||||
|
- conan export-pkg . $DRONE_COMMIT@pkmnlib/$DRONE_BRANCH --build-folder build-conan -s compiler='clang' -s compiler.version=8 -s compiler.libcxx='libstdc++11'
|
||||||
|
- conan remote add epsilon-public https://packages.p-epsilon.com/artifactory/api/conan/epsilon-public
|
||||||
|
- conan user -p -r=epsilon-public
|
||||||
|
- conan upload PkmnLib/$DRONE_COMMIT@pkmnlib/$DRONE_BRANCH --all -r=epsilon-public
|
||||||
|
- conan user --clean
|
16
conanfile.py
16
conanfile.py
|
@ -5,8 +5,8 @@ from conans.errors import ConanInvalidConfiguration
|
||||||
class PkmnLibConan(ConanFile):
|
class PkmnLibConan(ConanFile):
|
||||||
name = "PkmnLib"
|
name = "PkmnLib"
|
||||||
license = "TODO"
|
license = "TODO"
|
||||||
url = "https://git.p-epsilon.com/Deukhoofd/CreatureLib"
|
url = "https://git.p-epsilon.com/Deukhoofd/PkmnLib"
|
||||||
description = "The core implementation for turn based battling using creatures."
|
description = "An implementation of CreatureLib to handle Pokemon battling."
|
||||||
settings = "os", "compiler", "build_type"
|
settings = "os", "compiler", "build_type"
|
||||||
options = {"shared": [True, False], "script_handler": ["angelscript"]}
|
options = {"shared": [True, False], "script_handler": ["angelscript"]}
|
||||||
default_options = {"shared": True, "script_handler": "angelscript"}
|
default_options = {"shared": True, "script_handler": "angelscript"}
|
||||||
|
@ -16,17 +16,21 @@ class PkmnLibConan(ConanFile):
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
cmake = CMake(self)
|
cmake = CMake(self)
|
||||||
|
self.output.info("Target OS: %s." % self.settings.os)
|
||||||
|
if self.settings.os == "Windows":
|
||||||
|
self.output.warn("Noticed Windows target, setting Cmake WINDOWS=On.")
|
||||||
|
cmake.definitions["WINDOWS"] = "On"
|
||||||
cmake.configure()
|
cmake.configure()
|
||||||
cmake.build()
|
cmake.build()
|
||||||
|
|
||||||
def package(self):
|
def package(self):
|
||||||
self.copy("*.hpp", dst="include", src="src")
|
self.copy("*.hpp", dst="include", src="src")
|
||||||
self.copy("*.h", dst="include", src="src")
|
|
||||||
self.copy("*.lib", dst="lib", keep_path=False)
|
|
||||||
self.copy("*.dll", dst="bin", keep_path=False)
|
self.copy("*.dll", dst="bin", keep_path=False)
|
||||||
self.copy("*.dylib*", dst="lib", keep_path=False)
|
|
||||||
self.copy("*.so", dst="lib", keep_path=False)
|
self.copy("*.so", dst="lib", keep_path=False)
|
||||||
self.copy("*.a", dst="lib", keep_path=False)
|
|
||||||
|
def package_info(self):
|
||||||
|
self.cpp_info.libs = ["libpkmnLib"]
|
||||||
|
|
||||||
|
|
||||||
def imports(self):
|
def imports(self):
|
||||||
if self.settings.os == "Windows":
|
if self.settings.os == "Windows":
|
||||||
|
|
|
@ -29,7 +29,7 @@ public:
|
||||||
|
|
||||||
ContextPool* GetContextPool() { return _ctxPool; }
|
ContextPool* GetContextPool() { return _ctxPool; }
|
||||||
|
|
||||||
#define CALLHOOK(name, setup) \
|
#define CALL_HOOK(name, setup) \
|
||||||
auto s = _type->Get##name(); \
|
auto s = _type->Get##name(); \
|
||||||
if (!s.Exists) \
|
if (!s.Exists) \
|
||||||
return; \
|
return; \
|
||||||
|
@ -54,9 +54,9 @@ public:
|
||||||
ctx->PopState(); \
|
ctx->PopState(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
void Stack() override { CALLHOOK(Stack, ); }
|
void Stack() override { CALL_HOOK(Stack, ); }
|
||||||
|
|
||||||
void OnRemove() override { CALLHOOK(OnRemove, ); }
|
void OnRemove() override { CALL_HOOK(OnRemove, ); }
|
||||||
|
|
||||||
void OnBeforeTurn(const CreatureLib::Battling::BaseTurnChoice* choice) override {
|
void OnBeforeTurn(const CreatureLib::Battling::BaseTurnChoice* choice) override {
|
||||||
throw NotImplementedException(); // TODO
|
throw NotImplementedException(); // TODO
|
||||||
|
@ -67,33 +67,33 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreventAttack(CreatureLib::Battling::ExecutingAttack* attack, bool* outResult) override {
|
void PreventAttack(CreatureLib::Battling::ExecutingAttack* attack, bool* outResult) override {
|
||||||
CALLHOOK(PreventAttack, {
|
CALL_HOOK(PreventAttack, {
|
||||||
ctx->SetArgObject(0, (void*)attack);
|
ctx->SetArgObject(0, (void*)attack);
|
||||||
ctx->SetArgAddress(1, outResult);
|
ctx->SetArgAddress(1, outResult);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
void FailAttack(CreatureLib::Battling::ExecutingAttack* attack, bool* outFailed) override {
|
void FailAttack(CreatureLib::Battling::ExecutingAttack* attack, bool* outFailed) override {
|
||||||
CALLHOOK(FailAttack, {
|
CALL_HOOK(FailAttack, {
|
||||||
ctx->SetArgObject(0, (void*)attack);
|
ctx->SetArgObject(0, (void*)attack);
|
||||||
ctx->SetArgAddress(1, outFailed);
|
ctx->SetArgAddress(1, outFailed);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
void StopBeforeAttack(CreatureLib::Battling::ExecutingAttack* attack, bool* outResult) override {
|
void StopBeforeAttack(CreatureLib::Battling::ExecutingAttack* attack, bool* outResult) override {
|
||||||
CALLHOOK(StopBeforeAttack, {
|
CALL_HOOK(StopBeforeAttack, {
|
||||||
ctx->SetArgObject(0, (void*)attack);
|
ctx->SetArgObject(0, (void*)attack);
|
||||||
ctx->SetArgAddress(1, outResult);
|
ctx->SetArgAddress(1, outResult);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnBeforeAttack(CreatureLib::Battling::ExecutingAttack* attack) override {
|
void OnBeforeAttack(CreatureLib::Battling::ExecutingAttack* attack) override {
|
||||||
CALLHOOK(OnBeforeAttack, { ctx->SetArgObject(0, (void*)attack); })
|
CALL_HOOK(OnBeforeAttack, { ctx->SetArgObject(0, (void*)attack); })
|
||||||
}
|
}
|
||||||
|
|
||||||
void FailIncomingAttack(CreatureLib::Battling::ExecutingAttack* attack, CreatureLib::Battling::Creature* target,
|
void FailIncomingAttack(CreatureLib::Battling::ExecutingAttack* attack, CreatureLib::Battling::Creature* target,
|
||||||
bool* outResult) override {
|
bool* outResult) override {
|
||||||
CALLHOOK(FailIncomingAttack, {
|
CALL_HOOK(FailIncomingAttack, {
|
||||||
ctx->SetArgObject(0, (void*)attack);
|
ctx->SetArgObject(0, (void*)attack);
|
||||||
ctx->SetArgObject(1, (void*)target);
|
ctx->SetArgObject(1, (void*)target);
|
||||||
ctx->SetArgAddress(2, outResult);
|
ctx->SetArgAddress(2, outResult);
|
||||||
|
@ -101,7 +101,7 @@ public:
|
||||||
}
|
}
|
||||||
void IsInvulnerable(CreatureLib::Battling::ExecutingAttack* attack, CreatureLib::Battling::Creature* target,
|
void IsInvulnerable(CreatureLib::Battling::ExecutingAttack* attack, CreatureLib::Battling::Creature* target,
|
||||||
bool* outResult) override {
|
bool* outResult) override {
|
||||||
CALLHOOK(IsInvulnerable, {
|
CALL_HOOK(IsInvulnerable, {
|
||||||
ctx->SetArgObject(0, (void*)attack);
|
ctx->SetArgObject(0, (void*)attack);
|
||||||
ctx->SetArgObject(1, (void*)target);
|
ctx->SetArgObject(1, (void*)target);
|
||||||
ctx->SetArgAddress(2, outResult);
|
ctx->SetArgAddress(2, outResult);
|
||||||
|
@ -109,7 +109,7 @@ public:
|
||||||
}
|
}
|
||||||
void OnAttackMiss(CreatureLib::Battling::ExecutingAttack* attack,
|
void OnAttackMiss(CreatureLib::Battling::ExecutingAttack* attack,
|
||||||
CreatureLib::Battling::Creature* target) override {
|
CreatureLib::Battling::Creature* target) override {
|
||||||
CALLHOOK(OnAttackMiss, {
|
CALL_HOOK(OnAttackMiss, {
|
||||||
ctx->SetArgObject(0, (void*)attack);
|
ctx->SetArgObject(0, (void*)attack);
|
||||||
ctx->SetArgObject(1, (void*)target);
|
ctx->SetArgObject(1, (void*)target);
|
||||||
})
|
})
|
||||||
|
@ -117,7 +117,7 @@ public:
|
||||||
|
|
||||||
void ChangeAttackType(CreatureLib::Battling::ExecutingAttack* attack, CreatureLib::Battling::Creature* target,
|
void ChangeAttackType(CreatureLib::Battling::ExecutingAttack* attack, CreatureLib::Battling::Creature* target,
|
||||||
uint8_t hitNumber, uint8_t* outType) override {
|
uint8_t hitNumber, uint8_t* outType) override {
|
||||||
CALLHOOK(ChangeAttackType, {
|
CALL_HOOK(ChangeAttackType, {
|
||||||
ctx->SetArgObject(0, (void*)attack);
|
ctx->SetArgObject(0, (void*)attack);
|
||||||
ctx->SetArgObject(1, (void*)target);
|
ctx->SetArgObject(1, (void*)target);
|
||||||
ctx->SetArgByte(2, hitNumber);
|
ctx->SetArgByte(2, hitNumber);
|
||||||
|
@ -127,7 +127,7 @@ public:
|
||||||
|
|
||||||
void OnStatusMove(const CreatureLib::Battling::ExecutingAttack* attack, CreatureLib::Battling::Creature* target,
|
void OnStatusMove(const CreatureLib::Battling::ExecutingAttack* attack, CreatureLib::Battling::Creature* target,
|
||||||
uint8_t hitNumber) override {
|
uint8_t hitNumber) override {
|
||||||
CALLHOOK(OnStatusMove, {
|
CALL_HOOK(OnStatusMove, {
|
||||||
ctx->SetArgObject(0, (void*)attack);
|
ctx->SetArgObject(0, (void*)attack);
|
||||||
ctx->SetArgObject(1, (void*)target);
|
ctx->SetArgObject(1, (void*)target);
|
||||||
ctx->SetArgByte(2, hitNumber);
|
ctx->SetArgByte(2, hitNumber);
|
||||||
|
@ -136,7 +136,7 @@ public:
|
||||||
|
|
||||||
void PreventSecondaryEffects(const CreatureLib::Battling::ExecutingAttack* attack,
|
void PreventSecondaryEffects(const CreatureLib::Battling::ExecutingAttack* attack,
|
||||||
CreatureLib::Battling::Creature* target, uint8_t hitNumber, bool* outResult) override {
|
CreatureLib::Battling::Creature* target, uint8_t hitNumber, bool* outResult) override {
|
||||||
CALLHOOK(PreventSecondaryEffects, {
|
CALL_HOOK(PreventSecondaryEffects, {
|
||||||
ctx->SetArgObject(0, (void*)attack);
|
ctx->SetArgObject(0, (void*)attack);
|
||||||
ctx->SetArgObject(1, (void*)target);
|
ctx->SetArgObject(1, (void*)target);
|
||||||
ctx->SetArgByte(2, hitNumber);
|
ctx->SetArgByte(2, hitNumber);
|
||||||
|
@ -146,7 +146,7 @@ public:
|
||||||
|
|
||||||
void OnSecondaryEffect(const CreatureLib::Battling::ExecutingAttack* attack,
|
void OnSecondaryEffect(const CreatureLib::Battling::ExecutingAttack* attack,
|
||||||
CreatureLib::Battling::Creature* target, uint8_t hitNumber) override {
|
CreatureLib::Battling::Creature* target, uint8_t hitNumber) override {
|
||||||
CALLHOOK(OnSecondaryEffect, {
|
CALL_HOOK(OnSecondaryEffect, {
|
||||||
ctx->SetArgObject(0, (void*)attack);
|
ctx->SetArgObject(0, (void*)attack);
|
||||||
ctx->SetArgObject(1, (void*)target);
|
ctx->SetArgObject(1, (void*)target);
|
||||||
ctx->SetArgByte(2, hitNumber);
|
ctx->SetArgByte(2, hitNumber);
|
||||||
|
@ -155,7 +155,7 @@ public:
|
||||||
|
|
||||||
void OnAfterHits(const CreatureLib::Battling::ExecutingAttack* attack,
|
void OnAfterHits(const CreatureLib::Battling::ExecutingAttack* attack,
|
||||||
CreatureLib::Battling::Creature* target) override {
|
CreatureLib::Battling::Creature* target) override {
|
||||||
CALLHOOK(OnAfterHits, {
|
CALL_HOOK(OnAfterHits, {
|
||||||
ctx->SetArgObject(0, (void*)attack);
|
ctx->SetArgObject(0, (void*)attack);
|
||||||
ctx->SetArgObject(1, (void*)target);
|
ctx->SetArgObject(1, (void*)target);
|
||||||
})
|
})
|
||||||
|
@ -166,5 +166,5 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#undef CALLHOOK
|
#undef CALL_HOOK
|
||||||
#endif // PKMNLIB_ANGELSCRIPTSCRIPT_HPP
|
#endif // PKMNLIB_ANGELSCRIPTSCRIPT_HPP
|
||||||
|
|
Loading…
Reference in New Issue