-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.env.reproducible
91 lines (77 loc) · 1.97 KB
/
.env.reproducible
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/bin/bash
# Function to set up a reproducible environment for Kotlin
setup_kotlin_environment() {
echo "Setting up Kotlin environment..."
# Ensure Gradle Wrapper is present
if [ ! -f "gradlew" ]; then
echo "Generating Gradle Wrapper..."
gradle wrapper
fi
# Create Dockerfile for Kotlin
cat <<EOF > Dockerfile.kotlin
FROM openjdk:11
RUN apt-get update && \
apt-get install -y wget unzip
RUN wget https://services.gradle.org/distributions/gradle-7.4.2-bin.zip -P /tmp
RUN unzip -d /opt/gradle /tmp/gradle-7.4.2-bin.zip
ENV PATH=/opt/gradle/gradle-7.4.2/bin:\$PATH
WORKDIR /app
COPY . /app
RUN ./gradlew build
EOF
echo "Kotlin environment setup complete."
}
# Function to set up a reproducible environment for Swift
setup_swift_environment() {
echo "Setting up Swift environment..."
# Create Package.swift if not present
if [ ! -f "Package.swift" ]; then
echo "Creating Package.swift..."
cat <<EOF > Package.swift
// swift-tools-version:5.5
import PackageDescription
let package = Package(
name: "MyProject",
platforms: [
.macOS(.v10_15), .iOS(.v13)
],
dependencies: [
.package(url: "https://github.com/AreaLayer/firebolt-react-native.git", from: "5.4.0")
],
targets: [
.target(
name: "Firebolt",
dependencies: ["Alamofire"]),
]
)
EOF
fi
# Create Dockerfile for Swift
cat <<EOF > Dockerfile.swift
FROM swift:5.5
WORKDIR /app
COPY . /app
RUN swift build
EOF
# Create Fastfile for Fastlane
if [ ! -d "fastlane" ]; then
mkdir fastlane
cat <<EOF > fastlane/Fastfile
default_platform(:ios)
platform :ios do
desc "Build the app"
lane :build do
build_app(scheme: "MyProject")
end
end
EOF
fi
echo "Swift environment setup complete."
}
# Main script execution
main() {
setup_kotlin_environment
setup_swift_environment
echo "Reproducible environments for Kotlin and Swift have been set up."
}
main