Skip to content

Commit 04670c2

Browse files
Jason GauciMisterTea
authored andcommitted
Redirect external dir to imported. Create import script.
1 parent 8ec6b85 commit 04670c2

File tree

15,413 files changed

+1976518
-1
lines changed

Some content is hidden

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

15,413 files changed

+1976518
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.0.2)
22

3-
set(EXTERNAL_DIR "${CMAKE_SOURCE_DIR}/external")
3+
set(EXTERNAL_DIR "${CMAKE_SOURCE_DIR}/external_imported")
44

55
if(DISABLE_VCPKG)
66
else()
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
AccessModifierOffset: '-4'
3+
AlignEscapedNewlines: Left
4+
AllowAllConstructorInitializersOnNextLine: 'true'
5+
BinPackArguments: 'false'
6+
BinPackParameters: 'false'
7+
BreakConstructorInitializers: AfterColon
8+
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
9+
DerivePointerAlignment: 'false'
10+
FixNamespaceComments: 'true'
11+
IncludeBlocks: Regroup
12+
IndentCaseLabels: 'false'
13+
IndentPPDirectives: AfterHash
14+
IndentWidth: '4'
15+
Language: Cpp
16+
NamespaceIndentation: All
17+
PointerAlignment: Left
18+
SpaceBeforeCtorInitializerColon: 'false'
19+
SpaceInEmptyParentheses: 'false'
20+
SpacesInParentheses: 'true'
21+
Standard: Cpp11
22+
TabWidth: '4'
23+
UseTab: Never
24+
25+
...
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
4+
import os
5+
import re
6+
from cpt.packager import ConanMultiPackager
7+
from cpt.ci_manager import CIManager
8+
from cpt.printer import Printer
9+
10+
11+
class BuilderSettings(object):
12+
@property
13+
def username(self):
14+
""" Set catchorg as package's owner
15+
"""
16+
return os.getenv("CONAN_USERNAME", "catchorg")
17+
18+
@property
19+
def login_username(self):
20+
""" Set Bintray login username
21+
"""
22+
return os.getenv("CONAN_LOGIN_USERNAME", "horenmar")
23+
24+
@property
25+
def upload(self):
26+
""" Set Catch2 repository to be used on upload.
27+
The upload server address could be customized by env var
28+
CONAN_UPLOAD. If not defined, the method will check the branch name.
29+
Only master or CONAN_STABLE_BRANCH_PATTERN will be accepted.
30+
The master branch will be pushed to testing channel, because it does
31+
not match the stable pattern. Otherwise it will upload to stable
32+
channel.
33+
"""
34+
return os.getenv("CONAN_UPLOAD", "https://api.bintray.com/conan/catchorg/catch2")
35+
36+
@property
37+
def upload_only_when_stable(self):
38+
""" Force to upload when running over tag branch
39+
"""
40+
return os.getenv("CONAN_UPLOAD_ONLY_WHEN_STABLE", "True").lower() in ["true", "1", "yes"]
41+
42+
@property
43+
def stable_branch_pattern(self):
44+
""" Only upload the package the branch name is like a tag
45+
"""
46+
return os.getenv("CONAN_STABLE_BRANCH_PATTERN", r"v\d+\.\d+\.\d+")
47+
48+
@property
49+
def reference(self):
50+
""" Read project version from branch create Conan reference
51+
"""
52+
return os.getenv("CONAN_REFERENCE", "Catch2/{}".format(self._version))
53+
54+
@property
55+
def channel(self):
56+
""" Default Conan package channel when not stable
57+
"""
58+
return os.getenv("CONAN_CHANNEL", "testing")
59+
60+
@property
61+
def _version(self):
62+
""" Get version name from cmake file
63+
"""
64+
pattern = re.compile(r"project\(Catch2 LANGUAGES CXX VERSION (\d+\.\d+\.\d+)\)")
65+
version = "latest"
66+
with open("CMakeLists.txt") as file:
67+
for line in file:
68+
result = pattern.search(line)
69+
if result:
70+
version = result.group(1)
71+
return version
72+
73+
@property
74+
def _branch(self):
75+
""" Get branch name from CI manager
76+
"""
77+
printer = Printer(None)
78+
ci_manager = CIManager(printer)
79+
return ci_manager.get_branch()
80+
81+
82+
if __name__ == "__main__":
83+
settings = BuilderSettings()
84+
builder = ConanMultiPackager(
85+
reference=settings.reference,
86+
channel=settings.channel,
87+
upload=settings.upload,
88+
upload_only_when_stable=settings.upload_only_when_stable,
89+
stable_branch_pattern=settings.stable_branch_pattern,
90+
login_username=settings.login_username,
91+
username=settings.username,
92+
test_folder=os.path.join(".conan", "test_package"))
93+
builder.add()
94+
builder.run()
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
cmake_minimum_required(VERSION 3.2.0)
2+
project(test_package CXX)
3+
4+
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
5+
conan_basic_setup(TARGETS)
6+
7+
find_package(Catch2 REQUIRED CONFIG)
8+
9+
add_executable(${PROJECT_NAME} test_package.cpp)
10+
target_link_libraries(${PROJECT_NAME} CONAN_PKG::Catch2)
11+
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
from conans import ConanFile, CMake
4+
import os
5+
6+
7+
class TestPackageConan(ConanFile):
8+
settings = "os", "compiler", "build_type", "arch"
9+
generators = "cmake"
10+
11+
def build(self):
12+
cmake = CMake(self)
13+
cmake.configure()
14+
cmake.build()
15+
16+
def test(self):
17+
assert os.path.isfile(os.path.join(self.deps_cpp_info["Catch2"].rootpath, "licenses", "LICENSE.txt"))
18+
bin_path = os.path.join("bin", "test_package")
19+
self.run("%s -s" % bin_path, run_environment=True)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#define CATCH_CONFIG_MAIN
2+
3+
#include <catch2/catch.hpp>
4+
5+
int Factorial( int number ) {
6+
return number <= 1 ? 1 : Factorial( number - 1 ) * number;
7+
}
8+
9+
TEST_CASE( "Factorial Tests", "[single-file]" ) {
10+
REQUIRE( Factorial(0) == 1 );
11+
REQUIRE( Factorial(1) == 1 );
12+
REQUIRE( Factorial(2) == 2 );
13+
REQUIRE( Factorial(3) == 6 );
14+
REQUIRE( Factorial(10) == 3628800 );
15+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# This sets the default behaviour, overriding core.autocrlf
2+
* text=auto
3+
4+
# All source files should have unix line-endings in the repository,
5+
# but convert to native line-endings on checkout
6+
*.cpp text
7+
*.h text
8+
*.hpp text
9+
10+
# Windows specific files should retain windows line-endings
11+
*.sln text eol=crlf
12+
13+
# Keep executable scripts with LFs so they can be run after being
14+
# checked out on Windows
15+
*.py text eol=lf
16+
17+
18+
# Keep the single include header with LFs to make sure it is uploaded,
19+
# hashed etc with LF
20+
single_include/**/*.hpp eol=lf
21+
# Also keep the LICENCE file with LFs for the same reason
22+
LICENCE.txt eol=lf
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
custom: "https://www.paypal.me/horenmar"
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: Bug report
3+
about: Create an issue that documents a bug
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**Expected behavior**
14+
A clear and concise description of what you expected to happen.
15+
16+
**Reproduction steps**
17+
Steps to reproduce the bug.
18+
<!-- Usually this means a small and self-contained piece of code that uses Catch and specifying compiler flags if relevant. -->
19+
20+
21+
**Platform information:**
22+
<!-- Fill in any extra information that might be important for your issue. -->
23+
- OS: **Windows NT**
24+
- Compiler+version: **GCC v2.9.5**
25+
- Catch version: **v1.2.3**
26+
27+
28+
**Additional context**
29+
Add any other context about the problem here.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Feature request
3+
about: Create an issue that requests a feature or other improvement
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Description**
11+
Describe the feature/change you request and why do you want it.
12+
13+
**Additional context**
14+
Add any other context or screenshots about the feature request here.

0 commit comments

Comments
 (0)