Skip to content

Commit

Permalink
Huge refactor, add new project gen/editor, Fix #75
Browse files Browse the repository at this point in the history
  • Loading branch information
KritantaDev authored and KritantaDev committed Aug 27, 2021
1 parent 58cd661 commit 986420e
Show file tree
Hide file tree
Showing 34 changed files with 375 additions and 143 deletions.
18 changes: 9 additions & 9 deletions dragon → bin/dragon
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/usr/bin/env bash
export DRAGONVERS="1.5.1"
export DRAGONVERS="1.6.0"

# Defauld dragondir is ~/.dragon
if [ -z $DRAGONDIR ]; then export DRAGONDIR=$HOME/.dragon; fi

# Run setup wizard if dragondir is empty or nonexistant
if [ -z "$(ls -A $DRAGONDIR 2> /dev/null)" ]; then
python3 -m dragontools.wizard
python3 -m dragon.wizard
exit 0
fi


TOOLPATH=$(python3 -c 'from dragontools.util import tool_path; print(tool_path())')
TOOLPATH=$(python3 -c 'from dragon.util import tool_path; print(tool_path())')

# Load in colors and basic functions
source $TOOLPATH/util
Expand Down Expand Up @@ -56,7 +56,7 @@ while [ "$1" != "" ]; do
;;
g | gen | generate) gen=1
;;
n | nic | new) python3 $DRAGONDIR/bin/nic.py
n | nic | new | edit | create ) python3 -m dragon.editor
drexit
;;
exp | export) gen=1
Expand Down Expand Up @@ -103,14 +103,14 @@ while [ "$1" != "" ]; do
u | update ) update
drexit
;;
rs | respring ) python3 -m dragontools.device run killall -9 SpringBoard
rs | respring ) python3 -m dragon.device run killall -9 SpringBoard
drexit
;;
dr | devicerun ) shift
python3 -m dragontools.device run $*
python3 -m dragon.device run $*
drexit
;;
s | device) python3 -m dragontools.device setup
s | device) python3 -m dragon.device setup
;;
sr | rconf ) setupRemote
;;
Expand All @@ -132,7 +132,7 @@ while [ "$1" != "" ]; do
h | help | -h ) usage
drexit
;;
test ) python3 -m dragontools.test
test ) python3 -m dragon.test
drexit
;;
time ) N=`date +%s%N`; export PS4='+[$(((`date +%s%N`-$N)/1000000))ms][${BASH_SOURCE}:${LINENO}]: ${FUNCNAME[0]:+${FUNCNAME[0]}(): }';
Expand Down Expand Up @@ -219,7 +219,7 @@ if [ $install == 1 ] && [ $DRAGON_DPKG == 1 ]; then

INSTALL_CMD=$(yaml DragonMake "['icmd']" || echo "sbreload")

python3 -m dragontools.device run ${INSTALL_CMD} || drexit
python3 -m dragon.device run ${INSTALL_CMD} || drexit
fi

# --------
Expand Down
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
3 changes: 3 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sphinx==4.1.2
sphinx_rtd_theme==0.5.2
k2l==0.6.0
52 changes: 52 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys

sys.path.insert(0, os.path.abspath('../../'))

# -- Project information -----------------------------------------------------

project = 'dragon'
copyright = '2021, _kritanta'
author = '_kritanta'

# The full version, including alpha/beta/rc tags
release = '0.5.1'

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = []

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
10 changes: 10 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
dragon
=================================



.. toctree::
:maxdepth: 2
:caption: Contents:

quickstart
5 changes: 5 additions & 0 deletions docs/source/quickstart.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Quick-Start Guide
---------------------

Creating your first project

10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
from setuptools import setup

setup(name='dragon',
version='1.5.1',
version='1.6.0',
description='A powerful toolkit targeting Apple development research, '
'and packaging.',
author='kritanta',
url='https://github.com/DragonBuild/dragon',
requires=['pyyaml'],
packages=['dragongen', 'buildgen', 'dragontools'],
packages=['dragon', 'dragongen', 'buildgen'],
package_dir={
'dragon': 'src/dragon',
'dragongen': 'src/dragongen',
'dragontools': 'src/dragontools',
'buildgen': 'src/buildgen',
},
package_data={
'dragontools': ['shscripts/*', 'deployable/*'],
'dragon': ['shscripts/*', 'config/*'],
},
scripts=['dragon']
scripts=['bin/dragon']
)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
████ ▀█¬ ▐███████ ▐███▌ ▐██ ▐██ ▐██ ██▀ ▐██ ██▄ ██▌ ▐██ ▐██ ██ ██
▀███, ;.┌████████─▌ ████ ▀████▀██ ▐██ ▀████▀██ ▀███▀██▌ ▀█████▀ ██ ██
████ ▄▀╓██████████ ╫▌▄███▌ ▄▄▄.▄██
└████, ╓▄██└▄█████████▌▌ █████▀ ▀▀▀▀ version 1.5.1
└████, ╓▄██└▄█████████▌▌ █████▀ ▀▀▀▀ version 1.6.0
████████▀┌▄███████████═ ▄████▀ ~ kritanta
╙█████▄▓█████████████▓████▀
└▀████████████████████▀ this project was made possible by l0renzo pane.
Expand Down
59 changes: 59 additions & 0 deletions src/dragon/config/defaults.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
# Special thanks to uroboro for suggesting this
# Configurations here should provide enough default variables to create the specified module;
# Please reach out to _kritanta if you need advice on extending these
Defaults:
proj_build_dir: .dragon
builddir: $proj_build_dir/build
objdir: $proj_build_dir/obj
signdir: $proj_build_dir/sign
bridging-header: $name-Bridging-Header.h
dragondir: $$DRAGONDIR
toolchain-prefix: arm64-apple-darwin14-
tool-prefix: ''
cc: clang
cxx: clang++
ld: clang++
nopack: No
codesign: ldid
dsym: dsymutil
plutil: plutil
swift: swift
lipo: lipo
logos: $dragondir/src/logos/bin/logos.pl
cargo: cargo
cargo-nightly: 'cargo +nightly'
optool: $dragondir/bin/optool
stage:
- 'true'
wild_recurse: No
warnings: -Wall
optim: "0"
debug: -fcolor-diagnostics
idflag: ''
entflag: '-S'
entfile: ''
resource_dir: 'Resources'
fw_dirs:
- $dragondir/sdks/iPhoneOS.sdk/System/Library/PrivateFrameworks/
- $dragondir/frameworks
lib_dirs:
- $dragondir/lib
- '.'
additional_lib_dirs:
additional_fw_dirs:
cinclude: '-I$dragondir/include -I$dragondir/vendor/include -I$dragondir/include/_fallback -I$DRAGONDIR/headers/ -I$pwd'
stagedir: '_'
modulesinternal: '-fmodules -fcxx-modules -fmodule-name=$name -fbuild-session-file=$proj_build_dir/modules/ -fmodules-validate-once-per-build-session -fmodules-prune-after=345600 -fmodules-prune-interval=86400'

# Touching these without a firm grasp of what you're doing is likely to break things
# They serve to abstract how we slap together all of the clang args
InternalDefaults:
internalcflags: '$cinclude $debug $fwSearch $cflags $btarg -O$optim $targetprefix$targetvers $sysroot $header_includes $arc $triple $theosshim $macros $warnings $modulesinternal'
internalswiftflags: '-color-diagnostics -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -g -L/usr/lib/swift -swift-version 5 -module-name $name'
internalfflags: '$internalcflags $typeldflags $frameworks $libs $libflags $lopts $libSearch $ldflags $libs'
internalldflags: '$internalcflags $typeldflags $frameworks $libs $libflags $lopts $libSearch $ldflags $libs'
internalsigntarget: '$signdir/$build_target_file.unsigned'
internalsymtarget: '$signdir/$build_target_file.unsym'
internallibflags: '-lobjc -lc++'
pwd: '.'
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ plist:
debug:
name: DsymUtil
desc: Generating Debug Symbols for $name
cmd: $dsym \"$in\" 2&> /dev/null; cp $in $out
cmd: cp $in $out
sign:
name: $codesign
desc: Signing $name
Expand Down
File renamed without changes.
36 changes: 36 additions & 0 deletions src/dragon/config/targets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Targets:
sim:
all:
targetos: iphonesimulator
triple: MACHINE
arc: yes
fw_dirs:
- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
- $dragondir/frameworks
sysroot: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
archs:
- MACHINE
ios:
all:
targetos: iphoneos
targetvers: 10.0
triple: arm64-apple-ios$targetvers
targetprefix: -miphoneos-version-min=
arc: yes
sysroot: $dragondir/sdks/iPhoneOS.sdk
archs:
- armv7
- arm64
- arm64e
watchos:
all:
targetos: watchos
targetvers: 5.0
arc: yes
sysroot: $dragondir/sdks/WatchOS.sdk
archs: arm64_32
host:
all:
triple: MACHINE
archs:
- MACHINE
File renamed without changes.
Loading

0 comments on commit 986420e

Please sign in to comment.