Skip to content

Commit

Permalink
add version file that is used by cmake and release scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
mmozeiko committed Mar 7, 2017
1 parent 8e99768 commit 877c0ff
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 24 deletions.
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ else()

endif()

if(DEFINED ENV{RCLONE_BROWSER_VERSION})
add_definitions("-DRCLONE_BROWSER_VERSION=\"$ENV{RCLONE_BROWSER_VERSION}\"")
endif()
file(READ "VERSION" RCLONE_BROWSER_VERSION)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${rclone-browser_BINARY_DIR}/build")

Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.2
5 changes: 2 additions & 3 deletions scripts/release_macOS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,16 @@ then
exit 1
fi

VERSION=$1-`git rev-parse --short HEAD`

ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"/..
VERSION=`cat $ROOT/VERSION`-`git rev-parse --short HEAD`
BUILD="$ROOT"/build
TARGET=rclone-browser-$VERSION-macOS
APP="$TARGET"/"Rclone Browser.app"

rm -rf "$BUILD"
mkdir -p "$BUILD"
cd "$BUILD"
cmake .. -DCMAKE_PREFIX_PATH="$QTDIR" -DCMAKE_BUILD_TYPE=Release -DRCLONE_BROWSER_VERSION=$VERSION
cmake .. -DCMAKE_PREFIX_PATH="$QTDIR" -DCMAKE_BUILD_TYPE=Release
make -j2
cd ..

Expand Down
24 changes: 9 additions & 15 deletions scripts/release_windows.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ if "%1" == "" (
goto :eof
)

if "%2" == "" (
echo No version specified in cmdline!
goto :eof
)
set ARCH=%1
call "%VS120COMNTOOLS%..\..\VC\vcvarsall.bat" %ARCH%

set QT=C:\Qt\5.8.0-vs2013-%ARCH%
set PATH=%QT%\bin;%PATH%

set ARCH=%1
set VERSION=%2
set ROOT="%~dp0.."
set BUILD="%~dp0..\build\build\Release"

set /p VERSION=<"%ROOT%\VERSION"

where /q git.exe
if "%ERRORLEVEL%" equ "0" (
Expand All @@ -23,13 +25,6 @@ if "%ERRORLEVEL%" equ "0" (
set VERSION=%VERSION%-!COMMIT!
)

set QT=C:\Qt\5.8.0-desktop-vs2013-%ARCH%
set PATH=%QT%\bin;%PATH%

call "%VS120COMNTOOLS%..\..\VC\vcvarsall.bat" %ARCH%

set ROOT="%~dp0.."
set BUILD="%~dp0..\build\build\Release"
if "%ARCH%" == "x86" (
set TARGET="%~dp0rclone-browser-%VERSION%-win32"
set CMAKEGEN="Visual Studio 12"
Expand All @@ -43,8 +38,7 @@ if exist build rd /s /q build
mkdir build
cd build

echo cmake .. -G %CMAKEGEN% -DCMAKE_CONFIGURATION_TYPES="Release" -DRCLONE_BROWSER_VERSION=%VERSION%
cmake .. -G %CMAKEGEN% -DCMAKE_CONFIGURATION_TYPES="Release" -DRCLONE_BROWSER_VERSION=%VERSION%
cmake .. -G %CMAKEGEN% -DCMAKE_CONFIGURATION_TYPES="Release"
cmake --build . --config Release
popd

Expand Down
5 changes: 2 additions & 3 deletions src/CMakeLists.txt
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,10 @@ elseif(APPLE)
set(SOURCE ${SOURCE} osx_helper.mm)
endif()

set(RCLONE_BROWSER_VERSION "dev" CACHE STRING "rclone browser version")
add_definitions(-DRCLONE_BROWSER_VERSION="${RCLONE_BROWSER_VERSION}")

set(QRC resources.qrc)

add_definitions(-DRCLONE_BROWSER_VERSION="${RCLONE_BROWSER_VERSION}")

qt5_wrap_ui(UI_OUT ${UI})
qt5_wrap_cpp(MOC_OUT ${MOC})
qt5_add_resources(QRC_OUT ${QRC} OPTIONS "-no-compress")
Expand Down
Empty file modified src/Info.plist
100755 → 100644
Empty file.

0 comments on commit 877c0ff

Please sign in to comment.