Skip to content

Commit

Permalink
Generate appcast URL
Browse files Browse the repository at this point in the history
  • Loading branch information
khrykin committed Feb 14, 2020
1 parent d8a69db commit abf7ca1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions cmake/modules/GenerateVersionFile.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
#
# Make a version file containing the current version from git.
#

include(GetGitRevisionDescription)
git_describe(VERSION --tags)
git_get_repo_name(REPO_NAME)

message("REPO: ${REPO_NAME}")
# Get appcast url
string(REGEX REPLACE "^[^/]+/" "" GITHUB_REPO "${REPO_NAME}")
string(REGEX REPLACE "/[^/]+$" "" GITHUB_USER "${REPO_NAME}")
set(APPCAST_URL "https://${GITHUB_USER}.github.io/${GITHUB_REPO}/appcast.xml")

#parse the version information into pieces.
# Parse the version information into pieces.
string(REGEX REPLACE "^v([0-9]+)\\..*" "\\1" VERSION_MAJOR "${VERSION}")
string(REGEX REPLACE "^v[0-9]+\\.([0-9]+).*" "\\1" VERSION_MINOR "${VERSION}")
string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" VERSION_PATCH "${VERSION}")
Expand Down
1 change: 1 addition & 0 deletions cmake/modules/version.cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
const char *const ApplicationSettings::version = "@VERSION@";
const char *const ApplicationSettings::shortVersion = "@VERSION_SHORT@";
const char *const ApplicationSettings::repoName = "@REPO_NAME@";
const char *const ApplicationSettings::appcastURL = "@APPCAST_URL@";
2 changes: 1 addition & 1 deletion deployment/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@
<key>NSCalendarsUsageDescription</key>
<string>Strategr would be able to export activity sessions as events to the Calendar</string>
<key>SUFeedURL</key>
<string>https://khrykin.github.io/github-sparkle/appcast.xml</string>
<string>${APPCAST_URL}</string>
</dict>
</plist>
Binary file modified deployment/package.dmg
Binary file not shown.
3 changes: 1 addition & 2 deletions utility/applicationsettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ namespace ApplicationSettings {
const auto architectureString = "64";
#endif

const auto appcastURL = "https://khrykin.github.io/github-sparkle/appcast.xml";

extern const char *const version;
extern const char *const shortVersion;
extern const char *const repoName;
extern const char *const appcastURL;
}


Expand Down

0 comments on commit abf7ca1

Please sign in to comment.