Skip to content

Commit 2189d8c

Browse files
committed
modernize release mechanism. add -i flag
1 parent 7835272 commit 2189d8c

File tree

7 files changed

+316
-61
lines changed

7 files changed

+316
-61
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ mulle-xcode-settings.xcodeproj/nat.pbxuser
88
mulle-xcode-settings.xcodeproj/nat.perspectivev3mulle-xcode-settings.rb
99
mulle-xcode-settings.rb
1010
mulle-xcode-settings.xcodeproj/nat.perspectivev3
11-
mulle-xcode-settings.xcodeproj/project~.pbxproj
11+
mulle-xcode-settings.xcodeproj/project~.pbxproj
12+
bin/tap-info.sh

RELEASENOTES.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,53 @@
1-
### Releasenotes
1+
#### 0.6.3
22

3-
##### 0.6.2
3+
* added -i option, mainly to output `include_directories` in `CMakeSourcesAndHeaders.txt`
4+
* modernize release mechanism
5+
6+
#### 0.6.2
47

58
* improve Framework target output for not APPLE case
69
* split off Releasenotes into separate file
710
* fixed missing `find_library` and `target_include_directories` emission when using -2
811

9-
##### 0.6.1
12+
#### 0.6.1
1013

1114
* improve sexport reminder
1215

13-
##### 0.6.0
16+
### 0.6.0
1417

1518
* there is a new option `-2`. It generates a `CMakeLists.txt` that includes
1619
a file called `CMakeSourcesAndHeaders.txt`. This is a file that you can generate
1720
with an additional run of `mulle-xcode-to-cmake sexport`.
1821

19-
##### 0.5.4
22+
#### 0.5.4
2023

2124
* the reminder is now more readable
2225

23-
##### 0.5.3
26+
#### 0.5.3
2427

2528
* added another little hack for mulle-objc
2629
* output commandline arguments in the reminder
2730
* sexport now also prints the reminder
2831

29-
##### 0.5.2
32+
### 0.5.2
3033

3134
* add sexport command for generating source and header file lists
3235
* added -l switch, also for mulle-objc to specify the project language
3336
* fix a bug, when files are not group relative in Xcode
3437

35-
##### 0.4.1
38+
#### 0.4.1
3639

3740
* add a reminder how this file was generated. Actually useful sometimes.
3841

39-
##### 0.4.0
42+
### 0.4.0
4043

4144
* whitespace in target names is converted to '-'
4245
* bundle targets are supported now
4346
* added -n flag
4447
* fix framework resource copy stage
4548

4649

47-
##### 0.3.0
50+
### 0.3.0
4851

4952
* don't emit link commands for static library targets
5053
* add -s option
@@ -54,7 +57,7 @@ with an additional run of `mulle-xcode-to-cmake sexport`.
5457
* improved boiler-plate code
5558

5659

57-
##### 0.2.0
60+
### 0.2.0
5861

5962
* output resources too
6063
* allow to specify multiple targets
@@ -63,11 +66,11 @@ with an additional run of `mulle-xcode-to-cmake sexport`.
6366
* somewhat half hearted attempt to also support applications and bundles
6467
* quote paths with whitespace
6568

66-
##### 0.1.0
69+
### 0.1.0
6770

6871
* Fix some bugs. Add -p and -f options.
6972

7073

71-
#### 0.0
74+
# 0.0
7275

7376
* Quickly hacked together from mulle-xcode-settings.

bin/formula-info.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# -- Formula Info --
2+
# If you don't have this file, there will be no homebrew
3+
# formula operations.
4+
#
5+
PROJECT="mulle-xcode-to-cmake" # your project/repository name
6+
DESC="🎭 Convert Xcode projects to cmake CMakeLists.txt "
7+
LANGUAGE="objc" # c,cpp, objc, bash ...
8+
# NAME="${PROJECT}" # formula filename without .rb extension
9+
10+
#
11+
# Specify needed homebrew packages by name as you would when saying
12+
# `brew install`.
13+
#
14+
# Use the ${DEPENDENCY_TAP} prefix for non-official dependencies.
15+
# DEPENDENCIES and BUILD_DEPENDENCIES will be evaled later!
16+
# So keep them single quoted.
17+
#
18+
# DEPENDENCIES='${DEPENDENCY_TAP}mulle-concurrent
19+
# libpng
20+
# '
21+
22+
#
23+
# Build via mulle-build. If you don't like this
24+
# edit bin/release.sh. Need to specify mulle-build dependencies
25+
# so that brew picks up the internal path!
26+
#
27+
#BUILD_DEPENDENCIES='${BOOTSTRAP_TAP}mulle-build
28+
#${BOOTSTRAP_TAP}mulle-bootstrap
29+
#' # cmake may be useful to add

bin/release-info.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# -- Version Info --
2+
#
3+
# Keep these commented out, if the automatic detection works well
4+
# enough for you. If you don't have this file, there will be
5+
# not git operations.
6+
#
7+
VERSIONFILE=mulle-xcode-to-cmake.xcodeproj/project.pbxproj
8+
VERSIONNAME=CURRENT_PROJECT_VERSION

bin/release.sh

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
#! /usr/bin/env bash
2+
#
3+
# Copyright (c) 2017 Nat! - Codeon GmbH
4+
# All rights reserved.
5+
#
6+
# Redistribution and use in source and binary forms, with or without
7+
# modification, are permitted provided that the following conditions are met:
8+
#
9+
# Redistributions of source code must retain the above copyright notice, this
10+
# list of conditions and the following disclaimer.
11+
#
12+
# Redistributions in binary form must reproduce the above copyright notice,
13+
# this list of conditions and the following disclaimer in the documentation
14+
# and/or other materials provided with the distribution.
15+
#
16+
# Neither the name of Mulle kybernetiK nor the names of its contributors
17+
# may be used to endorse or promote products derived from this software
18+
# without specific prior written permission.
19+
#
20+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30+
# POSSIBILITY OF SUCH DAMAGE.
31+
#
32+
#
33+
# For documentation and help see:
34+
# https://github.com/mulle-nat/mulle-homebrew
35+
#
36+
# Run this somewhat like this (for real: remove -n):
37+
# ./bin/release.sh -v -n --publisher mulle-nat --publisher-tap mulle-kybernetik/software/
38+
#
39+
40+
EXE_DIR="`dirname -- $0`"
41+
42+
# if there is a release-info.sh file read it
43+
if [ -f "${EXE_DIR}/release-info.sh" ]
44+
then
45+
DO_GIT_RELEASE="YES"
46+
. "${EXE_DIR}/release-info.sh"
47+
fi
48+
49+
# if there is a formula-info.sh file read it
50+
if [ -f "${EXE_DIR}/formula-info.sh" ]
51+
then
52+
DO_GENERATE_FORMULA="YES"
53+
. "${EXE_DIR}/formula-info.sh"
54+
fi
55+
56+
#
57+
# If there is a - possibly .gitignored - tap-info.sh file read it.
58+
# It could store PUBLISHER and PUBLISHER_TAP
59+
#
60+
if [ -f "${EXE_DIR}/tap-info.sh" ]
61+
then
62+
. "${EXE_DIR}/tap-info.sh"
63+
fi
64+
65+
66+
#######
67+
# If you are using mulle-build, you don't hafta change anything after this
68+
#######
69+
70+
#
71+
# Generate your `def install` `test do` lines here. echo them to stdout.
72+
#
73+
generate_brew_formula_build()
74+
{
75+
local project="$1"
76+
local name="$2"
77+
local version="$3"
78+
79+
cat <<EOF
80+
def install
81+
xcodebuild "install", "-target", "${project}", "DSTROOT=/", "INSTALL_PATH=#{bin}"
82+
end
83+
84+
test do
85+
system "#{bin}/${project}", "-version"
86+
end
87+
EOF
88+
}
89+
90+
91+
#
92+
# If you are unhappy with the formula in general, then change
93+
# this function. Print your formula to stdout.
94+
#
95+
generate_brew_formula()
96+
{
97+
# local project="$1"
98+
# local name="$2"
99+
# local version="$3"
100+
# local dependencies="$4"
101+
# local builddependencies="$5"
102+
# local homepage="$6"
103+
# local desc="$7"
104+
# local archiveurl="$8"
105+
106+
_generate_brew_formula "$@"
107+
}
108+
109+
#######
110+
# Ideally changes to the following values are done with the command line
111+
# which makes it easier for forks.
112+
#######
113+
114+
MULLE_BOOTSTRAP_FAIL_PREFIX="`basename -- $0`"
115+
MULLE_HOMEBREW_VERSION="4.1.0"
116+
117+
#
118+
# prefer local mulle-homebrew if available
119+
# Do not embed it anymore!
120+
#
121+
if [ -z "`command -v mulle-homebrew-env`" ]
122+
then
123+
cat <<EOF >&2
124+
mulle-homebrew-env not found in PATH.
125+
Visit the homepage for installation instructions:
126+
https://github.com/mulle-nat/mulle-homebrew
127+
EOF
128+
exit 1
129+
fi
130+
131+
INSTALLED_MULLE_HOMEBREW_VERSION="`mulle-homebrew-env version`" || exit 1
132+
LIBEXEC_DIR="`mulle-homebrew-env libexec-path`" || exit 1
133+
134+
. "${LIBEXEC_DIR}/mulle-homebrew.sh" || exit 1
135+
. "${LIBEXEC_DIR}/mulle-git.sh" || exit 1
136+
. "${LIBEXEC_DIR}/mulle-version.sh" || exit 1
137+
. "${LIBEXEC_DIR}/mulle-environment.sh" || exit 1
138+
139+
140+
main()
141+
{
142+
if [ "${DO_GIT_RELEASE}" != "YES" -a "${DO_GENERATE_FORMULA}" != "YES" ]
143+
then
144+
fail "Nothing to do. release-info.sh and formula-info.sh are missing"
145+
fi
146+
147+
if [ "${DO_GIT_RELEASE}" = "YES" ]
148+
then
149+
# do the release
150+
git_main "${BRANCH}" "${ORIGIN}" "${TAG}" "${GITHUB}" || exit 1
151+
fi
152+
153+
if [ "${DO_GENERATE_FORMULA}" = "YES" ]
154+
then
155+
if [ -z "${PUBLISHER}" ]
156+
then
157+
fail "You need to specify a publisher with --publisher (hint: https://github.com/<publisher>)"
158+
fi
159+
160+
if [ -z "${PUBLISHER_TAP}" ]
161+
then
162+
fail "You need to specify a publisher tap with --tap (hint: <mulle-kybernetik/software>)"
163+
fi
164+
165+
# generate the formula and push it
166+
homebrew_main "${PROJECT}" \
167+
"${NAME}" \
168+
"${VERSION}" \
169+
"${DEPENDENCIES}" \
170+
"${BUILD_DEPENDENCIES}" \
171+
"${HOMEPAGE_URL}" \
172+
"${DESC}" \
173+
"${ARCHIVE_URL}" \
174+
"${HOMEBREW_TAP}" \
175+
"${RBFILE}"
176+
fi
177+
}
178+
179+
main "$@"

mulle-xcode-to-cmake.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@
369369
1DEB927908733DD40010E9CD /* Debug */ = {
370370
isa = XCBuildConfiguration;
371371
buildSettings = {
372-
CURRENT_PROJECT_VERSION = 0.6.2;
372+
CURRENT_PROJECT_VERSION = 0.6.3;
373373
DEBUG_INFORMATION_FORMAT = dwarf;
374374
DYLIB_COMPATIBILITY_VERSION = "$(CURRENT_PROJECT_VERSION)";
375375
DYLIB_CURRENT_VERSION = 0.0.0;
@@ -390,7 +390,7 @@
390390
1DEB927A08733DD40010E9CD /* Release */ = {
391391
isa = XCBuildConfiguration;
392392
buildSettings = {
393-
CURRENT_PROJECT_VERSION = 0.6.2;
393+
CURRENT_PROJECT_VERSION = 0.6.3;
394394
DEBUG_INFORMATION_FORMAT = dwarf;
395395
DYLIB_COMPATIBILITY_VERSION = "$(CURRENT_PROJECT_VERSION)";
396396
DYLIB_CURRENT_VERSION = 0.0.0;

0 commit comments

Comments
 (0)