Merge branch 'main' into beta

This commit is contained in:
David Capello 2021-03-19 19:27:29 -03:00
commit b015b16da5
17 changed files with 100 additions and 132 deletions

View File

@ -1,23 +0,0 @@
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
VCVARS_FILE: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat
VCVARS_ARG:
ENABLE_UI: ON
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
VCVARS_FILE: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat
VCVARS_ARG:
ENABLE_UI: ON
install:
- call "%VCVARS_FILE%" %VCVARS_ARG%
before_build:
- git submodule update --init --recursive
build_script:
- mkdir build
- cd build
- cmake .. -G "NMake Makefiles" -DENABLE_TESTS=ON -DENABLE_UI=%ENABLE_UI%
- nmake
- ctest --output-on-failure

58
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,58 @@
name: build
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
build_type: [debug]
enable_ui: [off]
include:
- os: ubuntu-latest
build_type: debug
enable_ui: on
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: ilammy/msvc-dev-cmd@v1
if: runner.os == 'Windows'
- name: Install Dependencies
shell: bash
run: |
if [[ "${{ runner.os }}" == "Linux" ]] ; then
sudo apt-get update -qq
sudo apt-get install -y \
libx11-dev libxcursor-dev libxi-dev
fi
- name: Generating Makefiles
shell: bash
run: |
cmake -S . -B build -G Ninja \
-DENABLE_TESTS=ON \
-DENABLE_UI=${{ matrix.enable_ui }}
- name: Compiling
shell: bash
run: |
cd build && ninja
- name: Running C++ Tests
shell: bash
run: |
if [[ "${{ runner.os }}" == "Linux" ]] ; then
export XVFB=xvfb-run
fi
cd build && $XVFB ctest --output-on-failure
- name: Running CLI Tests
shell: bash
run: |
if [[ "${{ runner.os }}" == "Linux" ]] ; then
export XVFB=xvfb-run
fi
cd build
export ASEPRITE=$PWD/bin/aseprite
git clone --recursive https://github.com/aseprite/tests.git
cd tests
$XVFB bash run-tests.sh

View File

@ -1,75 +0,0 @@
language: cpp
matrix:
include:
- os: osx
env:
- ENABLE_UI=ON
- MATRIX_EVAL="wget https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-mac.zip && unzip ninja-mac.zip && export PATH=$PWD:$PATH"
- os: linux
addons:
apt:
packages:
- libpixman-1-dev libfreetype6-dev libharfbuzz-dev libx11-dev libxcursor-dev libxi-dev ninja-build
env:
- ENABLE_UI=OFF
- XVFB=xvfb-run
- os: linux
addons:
apt:
packages:
- libpixman-1-dev libfreetype6-dev libharfbuzz-dev libx11-dev libxcursor-dev libxi-dev ninja-build
env:
- ENABLE_SCRIPTING=OFF
- XVFB=xvfb-run
- os: linux
addons:
apt:
packages:
- libpixman-1-dev libfreetype6-dev libharfbuzz-dev libx11-dev libxcursor-dev libxi-dev ninja-build
env:
- ENABLE_SCRIPTING=OFF
- ENABLE_UI=OFF
- SKIP_TESTS_REPO=ON
- XVFB=xvfb-run
- os: linux
addons:
apt:
packages:
- libpixman-1-dev libfreetype6-dev libharfbuzz-dev libx11-dev libxcursor-dev libxi-dev ninja-build
env:
- ENABLE_UI=ON
- XVFB=xvfb-run
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7 libpixman-1-dev libfreetype6-dev libharfbuzz-dev libx11-dev libxcursor-dev libxi-dev ninja-build
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
- ENABLE_UI=ON
- XVFB=xvfb-run
before_install:
- eval "${MATRIX_EVAL}"
before_script:
- mkdir build
- cd build
- cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Debug -DENABLE_TESTS=ON -DENABLE_UI=$ENABLE_UI
script:
- ninja
- |
if $XVFB ctest --output-on-failure ; then
if [ "$SKIP_TESTS_REPO" == "" ] ; then
export ASEPRITE=$PWD/bin/aseprite
git clone --recursive https://github.com/aseprite/tests.git
cd tests
$XVFB bash run-tests.sh
fi
else
exit 1
fi

View File

@ -15,7 +15,7 @@ if(COMMAND cmake_policy)
# CMP0046: Old behavior to silently ignore non-existent dependencies.
cmake_policy(SET CMP0046 OLD)
endif()
endif(COMMAND cmake_policy)
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING

View File

@ -77,12 +77,12 @@ encouraged to create mockups for any issue you see and attach them.
## Hacking
The first thing to keep in mind if you want to modify the source code:
checkout the **master** branch. It is the branch that we use to
checkout the **main** branch. It is the branch that we use to
develop new features and fix issues that are planned for the next big
release. See the [INSTALL](INSTALL.md) guide to know how to compile.
To start looking the source code, see how it is organized in
[src/README.md](https://github.com/aseprite/aseprite/tree/master/src/#aseprite-source-code)
[src/README.md](https://github.com/aseprite/aseprite/tree/main/src/#aseprite-source-code)
file.
## Forking & Pull Requests
@ -93,22 +93,22 @@ You can fork the GitHub repository using the Fork button at
The Pull Requests (PR) systems works in this way:
1. First of all you will need to sign our
[Contributor License Agreement](https://github.com/aseprite/sourcecode/blob/master/sign-cla.md#sign-the-cla) (CLA).
1. Then you can start working on Aseprite. Create a new branch from `master`, e.g. `fix-8` to fix the issue 8.
[Contributor License Agreement](https://github.com/aseprite/sourcecode/blob/main/sign-cla.md#sign-the-cla) (CLA).
1. Then you can start working on Aseprite. Create a new branch from `main`, e.g. `fix-8` to fix the issue 8.
Check this guide about [how to name your branch](https://github.com/agis/git-style-guide#branches).
1. Start working on that new branch, and push your commits to your fork.
1. Create a new PR to merge your `fix-8` branch to the official `master`.
1. Create a new PR to merge your `fix-8` branch to the official `main`.
1. If the PR is accepted (does not require review/comments/modifications),
your branch is merged into `master`.
1. You will need to pull changes from the official `master` branch, and
merge them in your own `master` branch. Finally you can discard your
your branch is merged into `main`.
1. You will need to pull changes from the official `main` branch, and
merge them in your own `main` branch. Finally you can discard your
own `fix-8` branch (because those changes should be already merged
into `master` if the PR was accepted).
1. Continue working from the new `master` head.
into `main` if the PR was accepted).
1. Continue working from the new `main` head.
To keep in mind: **always** start working from the `master` head, if you
To keep in mind: **always** start working from the `main` head, if you
want to fix three different issues, create three different branches
from `master` and then send three different PR. Do not chain all the
from `main` and then send three different PR. Do not chain all the
fixes in one single branch. E.g. `fix-issues-3-and-8-and-25`.
## Community

View File

@ -1,7 +1,6 @@
# Aseprite
[![Build Status](https://travis-ci.org/aseprite/aseprite.svg)](https://travis-ci.org/aseprite/aseprite)
[![Build status](https://ci.appveyor.com/api/projects/status/kdu2gt7ls014i25h?svg=true)](https://ci.appveyor.com/project/dacap/aseprite)
[![build](https://github.com/aseprite/aseprite/actions/workflows/build.yml/badge.svg)](https://github.com/aseprite/aseprite/actions/workflows/build.yml)
[![Discourse Community](https://img.shields.io/badge/discourse-community-brightgreen.svg?style=flat)](https://community.aseprite.org/)
[![Discord Server](https://discordapp.com/api/guilds/324979738533822464/embed.png)](https://discord.gg/Yb2CeX8)

View File

@ -16,8 +16,8 @@ because they don't depend on any other component.
* [clip](https://github.com/aseprite/clip): Clipboard library.
* [fixmath](fixmath/): Fixed point operations (original code from Allegro code by Shawn Hargreaves).
* [flic](https://github.com/aseprite/flic): Library to load/save FLI/FLC files.
* laf/[base](https://github.com/aseprite/laf/tree/master/base): Core/basic stuff, multithreading, utf8, sha1, file system, memory, etc.
* laf/[gfx](https://github.com/aseprite/laf/tree/master/gfx): Abstract graphics structures like point, size, rectangle, region, color, etc.
* laf/[base](https://github.com/aseprite/laf/tree/main/base): Core/basic stuff, multithreading, utf8, sha1, file system, memory, etc.
* laf/[gfx](https://github.com/aseprite/laf/tree/main/gfx): Abstract graphics structures like point, size, rectangle, region, color, etc.
* [observable](https://github.com/aseprite/observable): Signal/slot functions.
* [scripting](scripting/): JavaScript engine.
* [steam](steam/): Steam API wrapper to avoid static linking to the .lib file.
@ -28,7 +28,7 @@ because they don't depend on any other component.
* [cfg](cfg/) (base): Library to load/save .ini files.
* [gen](gen/) (base): Helper utility to generate C++ files from different XMLs.
* [net](net/) (base): Networking library to send HTTP requests.
* laf/[os](https://github.com/aseprite/laf/tree/master/os) (base, gfx, wacom): OS input/output.
* laf/[os](https://github.com/aseprite/laf/tree/main/os) (base, gfx, wacom): OS input/output.
## Level 2

View File

@ -334,6 +334,7 @@ int App::initialize(const AppOptions& options)
// Process options
LOG("APP: Processing options...\n");
int code;
{
std::unique_ptr<CliDelegate> delegate;
if (options.previewCLI())
@ -342,14 +343,12 @@ int App::initialize(const AppOptions& options)
delegate.reset(new DefaultCliDelegate);
CliProcessor cli(delegate.get(), options);
int code = cli.process(context());
if (code != 0)
return code;
code = cli.process(context());
}
LOG("APP: Finish launching...\n");
system->finishLaunching();
return 0;
return code;
}
void App::run()

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2018-2020 Igara Studio S.A.
// Copyright (C) 2018-2021 Igara Studio S.A.
// Copyright (C) 2001-2018 David Capello
//
// This program is distributed under the terms of
@ -532,7 +532,14 @@ int CliProcessor::process(Context* ctx)
// --script <filename>
else if (opt == &m_options.script()) {
std::string filename = value.value();
int code = m_delegate->execScript(filename, scriptParams);
int code;
try {
code = m_delegate->execScript(filename, scriptParams);
}
catch (const std::exception& ex) {
Console::showException(ex);
return -1;
}
if (code != 0)
return code;
}

View File

@ -185,7 +185,6 @@ void Console::printf(const char* format, ...)
// static
void Console::showException(const std::exception& e)
{
ui::assert_ui_thread();
if (!ui::is_ui_thread()) {
LOG(ERROR, "A problem has occurred.\n\nDetails:\n%s\n", e.what());
return;

View File

@ -11,6 +11,9 @@
#include "doc/algorithm/flip_image.h"
#include "render/gradient.h"
#include <array>
#include <memory>
namespace app {
namespace tools {

@ -1 +1 @@
Subproject commit 5377679fd32f977b32b51d83e0fdc027adcdfe78
Subproject commit f13c9656d51482c1908c9a551ce76f9450b7bd55

@ -1 +1 @@
Subproject commit 5cc35476177355e035d2ea4b8f7465bb1addb93c
Subproject commit 1e0630d310b55abf7d16d3d89feeb13936d540f8

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2019-2020 Igara Studio S.A.
// Copyright (C) 2019-2021 Igara Studio S.A.
// Copyright (C) 2001-2016 David Capello
//
// This program is distributed under the terms of
@ -94,14 +94,15 @@ int app_main(int argc, char* argv[])
}
const int code = app.initialize(options);
if (code != 0)
return code;
if (options.startShell())
systemConsole.prepareShell();
app.run();
return 0;
// After starting the GUI, we'll always return 0, but in batch
// mode we can return the error code.
return (app.isGui() ? 0: code);
}
catch (std::exception& e) {
std::cerr << e.what() << '\n';

@ -1 +1 @@
Subproject commit a9d766bd495b0af0f5da8c717c3e9061290a5a9e
Subproject commit af94c4a2317839ce629eb26ce47b80e810cbdaec

@ -1 +1 @@
Subproject commit db4237e672d9e7370f074a273b49644588754d82
Subproject commit ea8005303f42925fa1180d1f6e973a816c0b80af

@ -1 +1 @@
Subproject commit 64bc33ab67c42330cc6cedd528c23eb33c445d64
Subproject commit e72730478aa6d4dc3be0c914058a7e0561aabe1e