Skip to content

Commit b1921df

Browse files
committed
redub: bypass android and freebsd
1 parent df61f0e commit b1921df

File tree

1 file changed

+30
-18
lines changed

1 file changed

+30
-18
lines changed

source/impl.d

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -184,44 +184,56 @@ class CompilerManager
184184
log("Installing redub build system");
185185

186186
string redubUrl = "https://github.com/MrcSnm/redub/releases/latest/download";
187+
string redubFile;
187188

188189
version (Windows)
189-
immutable redubFile = fmt("redub-%s-latest-%s.exe", this.currentOS, this.currentArch);
190+
redubFile = fmt("redub-%s-latest-%s.exe", this.currentOS, this.currentArch);
190191
else version (FreeBSD)
191192
enforce(0, "Redub is not supported on FreeBSD");
193+
else version (Android)
194+
enforce(0, "Redub is not supported on Android");
192195
else version (linux)
193196
{
194197
version (AArch64)
195-
immutable redubFile = "redub-ubuntu-24.04-arm-arm64";
198+
redubFile = "redub-ubuntu-24.04-arm-arm64";
196199
else
197200
{
198201
version (CRuntime_Musl)
199-
immutable redubFile = fmt("redub-%s-%s", this.currentOS, this.currentArch);
202+
redubFile = fmt("redub-%s-%s", this.currentOS, this.currentArch);
200203
else
201-
immutable redubFile = fmt("redub-ubuntu-latest-%s", this.currentArch);
204+
redubFile = fmt("redub-ubuntu-latest-%s", this.currentArch);
202205
}
203206
}
204207
else version (OSX)
205-
immutable redubFile = fmt("redub-%s-latest-%s", this.currentOS, this.currentArch);
208+
redubFile = fmt("redub-%s-latest-%s", this.currentOS, this.currentArch);
206209
else
207210
static assert(0, "Unsupported operating system");
208211

209-
redubUrl ~= "/" ~ redubFile;
210-
211-
version (Windows)
212-
string redubExe = buildPath(rootPath, "redub.exe");
212+
version (FreeBSD)
213+
{
214+
}
215+
version (Android)
216+
{
217+
}
213218
else
214-
immutable redubExe = buildPath(rootPath, "redub");
219+
{
220+
redubUrl ~= "/" ~ redubFile;
215221

216-
if (!exists(redubExe))
217-
download(redubUrl, redubExe);
218-
else
219-
log("Redub already installed");
222+
version (Windows)
223+
string redubExe = buildPath(rootPath, "redub.exe");
224+
else
225+
immutable redubExe = buildPath(rootPath, "redub");
220226

221-
version (Posix)
222-
{
223-
// Make executable
224-
executeShell("chmod +x " ~ redubExe);
227+
if (!exists(redubExe))
228+
download(redubUrl, redubExe);
229+
else
230+
log("Redub already installed");
231+
232+
version (Posix)
233+
{
234+
// Make executable
235+
executeShell("chmod +x " ~ redubExe);
236+
}
225237
}
226238
}
227239

0 commit comments

Comments
 (0)