Skip to content

Commit

Permalink
Merge pull request #6 from sunxfancy/develop
Browse files Browse the repository at this point in the history
v0.6.0 finished!
  • Loading branch information
xssss1 authored Nov 16, 2017
2 parents b2601db + f01777a commit c30eaaa
Show file tree
Hide file tree
Showing 41 changed files with 1,267 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ upload:
twine upload dist/*

clean:
rm -rf *.egg-info templates/*.zip build dist
rm -rf *.egg-info templates/*.zip build dist
.PHONY: build upload clean
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def run(self):

setup(
name='codefactory', #名称
version='0.5.5', #版本
version='0.6.0', #版本
description="a native code builder using git, github service and cmake", #描述
keywords='codef code factory builder cmake github',
author='sunxfancy', #作者
Expand All @@ -44,7 +44,7 @@ def run(self):
license='MIT',
packages=find_packages(exclude=['ez_setup', 'examples', 'autotest']),
zip_safe=True,
data_files=[('share/codefactory/templates/', ['templates/cpp.zip'])], # 原版正确的
data_files=[('share/codefactory/templates/', ['templates/cpp.zip', 'templates/cpplib.zip'])], # 原版正确的

install_requires=[ #需求的第三方模块
],
Expand Down
6 changes: 3 additions & 3 deletions templates/cpp/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ addons:
apt:
packages:
- clang
- ninja-build

before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install clang; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then apt-get update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ninja; fi

script:
install:
- bash ./.travis/install.sh

script:
Expand Down
4 changes: 2 additions & 2 deletions templates/cpp/.travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ if [[ "$(uname -s)" == 'Darwin' ]]; then
pyenv activate conan
fi

pip install conan_package_tools # It install conan too
pip install codef
sudo pip install conan
sudo pip install codefactory
conan user sunxfancy
2 changes: 1 addition & 1 deletion templates/cpp/CMakeLists.txt.tj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SET(VERSION_MAJOR "0")
SET(VERSION_MINOR "1")
SET(VERSION_PATCH "0")

SET (CMAKE_BUILD_TYPE Debug) # 默认构建Debug模式
SET (CMAKE_BUILD_TYPE Release) # 默认构建Debug模式

include_directories(src include)

Expand Down
2 changes: 2 additions & 0 deletions templates/cpp/README.md.tj
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{=name=}
=================
4 changes: 3 additions & 1 deletion templates/cpp/conanfile.py.tj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ class {=name=}Conan(ConanFile):
generators = "cmake"
build_policy = "missing"
requires = 'gtest/1.8.0@lasote/stable'

exports = "*"

def build(self):
cmake = CMake(self)
self.run('cmake ../.. %s' % cmake.command_line)
Expand All @@ -24,6 +25,7 @@ class {=name=}Conan(ConanFile):
self.copy("*.so", dst="lib", keep_path=False)
self.copy("*.dylib", dst="lib", keep_path=False)
self.copy("*.a", dst="lib", keep_path=False)
self.copy("LICENSE", dst=".", keep_path=False)

def package_info(self):
self.cpp_info.libs = [self.name]
14 changes: 14 additions & 0 deletions templates/cpplib/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
*.*~
*.bc
.fuse*
*.sublime-*
.clang_complete
__pycache__/
test_package/__pycache__/
.vscode/
bin/
lib/
build/
test_package/build
build-doc/

49 changes: 49 additions & 0 deletions templates/cpplib/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
env:
global:
- CONAN_REFERENCE: "{=name=}/0.1.0"
# - CONAN_USERNAME: "sunxfancy"
# - CONAN_LOGIN_USERNAME: "sunxfancy"
- CONAN_CHANNEL: "ci"
# - CONAN_UPLOAD: "https://api.bintray.com/conan/elite-lang/eobject"
- CONAN_STABLE_BRANCH_PATTERN: "master"

linux: &linux
os: linux
sudo: required
language: python
python: "3.6"
services:
- docker
osx: &osx
os: osx
language: generic

matrix:
include:
- <<: *linux
env: CONAN_GCC_VERSIONS=4.9 CONAN_DOCKER_IMAGE=lasote/conangcc49
- <<: *linux
env: CONAN_GCC_VERSIONS=5.4 CONAN_DOCKER_IMAGE=lasote/conangcc54
- <<: *linux
env: CONAN_GCC_VERSIONS=6.3 CONAN_DOCKER_IMAGE=lasote/conangcc63
- <<: *linux
env: CONAN_CLANG_VERSIONS=3.9 CONAN_DOCKER_IMAGE=lasote/conanclang39
- <<: *linux
env: CONAN_CLANG_VERSIONS=4.0 CONAN_DOCKER_IMAGE=lasote/conanclang40
- <<: *osx
osx_image: xcode7.3
env: CONAN_APPLE_CLANG_VERSIONS=7.3
- <<: *osx
osx_image: xcode8.2
env: CONAN_APPLE_CLANG_VERSIONS=8.0
- <<: *osx
osx_image: xcode8.3
env: CONAN_APPLE_CLANG_VERSIONS=8.1

install:
- chmod +x .travis/install.sh
- ./.travis/install.sh

script:
- chmod +x .travis/run.sh
- ./.travis/run.sh
25 changes: 25 additions & 0 deletions templates/cpplib/.travis/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

set -e
set -x

if [[ "$(uname -s)" == 'Darwin' ]]; then
brew update || brew update
brew outdated pyenv || brew upgrade pyenv
brew install pyenv-virtualenv
brew install cmake || true

if which pyenv > /dev/null; then
eval "$(pyenv init -)"
fi

pyenv install 2.7.10
pyenv virtualenv 2.7.10 conan
pyenv rehash
pyenv activate conan
fi

sudo pip install conan --upgrade
sudo pip install conan_package_tools

conan user
13 changes: 13 additions & 0 deletions templates/cpplib/.travis/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

set -e
set -x

if [[ "$(uname -s)" == 'Darwin' ]]; then
if which pyenv > /dev/null; then
eval "$(pyenv init -)"
fi
pyenv activate conan
fi

python build.py
19 changes: 19 additions & 0 deletions templates/cpplib/Authors
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## 请贡献者将自己添加到作者列表中,您的一点一滴贡献,都值得我们永远记忆 ##
## 我们也会定期检查并更新该列表,以确认是否全部贡献都得到记录 ##
## 以下列表按照字母序排列,母语非英语的贡献者可以将自己的母语名字添加到英文名后 ##

## Please contribute to the list of authors, your little bit of contribution, are worthy of our memory forever ##
## We also periodically check and update the list to see if all contributions have been recorded ##
## The following list is in alphabetical order, and contributors who are not native English speakers can add their native language names to English names ##


Creator
-------------





Contributor
-------------

13 changes: 13 additions & 0 deletions templates/cpplib/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Change Log
===============

### V0.1.1


------------------------

### V0.1.0 2015-11-02

The first commit
这是本项目的第一个版本

43 changes: 43 additions & 0 deletions templates/cpplib/CMakeLists.txt.tj
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
cmake_minimum_required(VERSION 2.8)
project("{=name=}")

if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/build/conanbuildinfo.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/build/conanbuildinfo.cmake)
else()
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
endif()
conan_basic_setup()

SET(VERSION_MAJOR "0")
SET(VERSION_MINOR "1")
SET(VERSION_PATCH "0")

SET (CMAKE_BUILD_TYPE Release) # 默认构建Debug模式

include_directories(src include)

set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )


file(GLOB_RECURSE source_files
${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp
)
list(REMOVE_ITEM source_files ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp)

# 生成库目标
add_library(${PROJECT_NAME} ${source_files})

# 链接动态库
target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS})

# 指定动态库版本
# VERSION 动态库版本
# SOVERSION API版本
if (BUILD_SHARED_LIBS)
set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} SOVERSION ${VERSION_MAJOR})
endif()

add_subdirectory(doc)
add_subdirectory(test)
21 changes: 21 additions & 0 deletions templates/cpplib/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2016 西风逍遥游

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 2 additions & 0 deletions templates/cpplib/README.md.tj
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{=name=}
=================
32 changes: 32 additions & 0 deletions templates/cpplib/appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
build: false

environment:
PYTHON: "C:\\Python27"
PYTHON_VERSION: "2.7.8"
PYTHON_ARCH: "32"

CONAN_REFERENCE: "{=name=}/0.1.0"
# CONAN_USERNAME: "sunxfancy"
# CONAN_LOGIN_USERNAME: "sunxfancy"
CONAN_CHANNEL: "ci"
VS150COMNTOOLS: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\Common7\\Tools\\"
# CONAN_UPLOAD: "https://api.bintray.com/conan/elite-lang/eobject"
CONAN_STABLE_BRANCH_PATTERN: "master"

matrix:
- MINGW_CONFIGURATIONS: "4.9@x86_64@seh@posix, 4.9@x86_64@sjlj@posix, 4.9@x86@sjlj@posix, 4.9@x86@dwarf2@posix"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
CONAN_VISUAL_VERSIONS: 12
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
CONAN_VISUAL_VERSIONS: 14
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
CONAN_VISUAL_VERSIONS: 15

install:
- set PATH=%PATH%;%PYTHON%/Scripts/
- pip.exe install conan --upgrade
- pip.exe install conan_package_tools
- conan user # It creates the conan data directory

test_script:
- python build.py
8 changes: 8 additions & 0 deletions templates/cpplib/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from conan.packager import ConanMultiPackager
import platform


if __name__ == "__main__":
builder = ConanMultiPackager(args="--build missing")
builder.add_common_builds()
builder.run()
14 changes: 14 additions & 0 deletions templates/cpplib/cmake/ClangConf.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
SET (CMAKE_CXX_COMPILER_ENV_VAR "clang++ ")
SET (CMAKE_CXX_FLAGS_DEBUG "-g")
SET (CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELEASE "-O4 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
if (APPLE)
SET (CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++")
elseif(COVERAGE_FLAG)
SET (CMAKE_CXX_FLAGS "-std=c++11 -coverage")
else()
SET (CMAKE_CXX_FLAGS "-std=c++11")
endif()
# SET (CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
# SET (CMAKE_SHARED_LINKER_FLAGS "-static-libgcc -static-libstdc++")
22 changes: 22 additions & 0 deletions templates/cpplib/cmake/CombineHeader.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@


ADD_CUSTOM_TARGET(header
COMMAND ${CMAKE_COMMAND} -E copy_directory ../ExIconv/include header
COMMAND ${CMAKE_COMMAND} -E copy_directory ../Lex/include header
COMMAND ${CMAKE_COMMAND} -E copy_directory ../LR_Scanner/includes header
COMMAND ${CMAKE_COMMAND} -E copy_directory ../RedApple/includes header
COMMAND ${CMAKE_COMMAND} -E copy_directory ../Builder/include header
COMMAND ${CMAKE_COMMAND} -E copy_directory ../MetaScriptRunner/include header
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating headers"
VERBATIM)

install(DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}/build/header
DESTINATION .
FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_READ WORLD_READ
DIRECTORY_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_READ WORLD_READ
COMPONENT header
PATTERN ".git" EXCLUDE)
Loading

0 comments on commit c30eaaa

Please sign in to comment.