-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpull
executable file
·147 lines (117 loc) · 5.28 KB
/
pull
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#!/usr/bin/env bash
#
# Copyright 2024, TeamDev. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Redistribution and use in source and/or binary forms, with or without
# modification, must retain the above copyright notice and the following
# disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
################################################################################
#
# The script to update the project configuration files.
#
# The code of the script assumes that:
# 1. The project uses this code as a Git sub-module installed in the `config`
# directory under the project root.
# 2. The script is called from the root of the project.
#
################################################################################
# Update the module with reference to the latest version.
# In this state there is no current branch.
git submodule update
# Make the `config` dir current.
cd ./config || { echo "Error: 'config' directory is missing."; exit 1; }
# Set the current branch to `master`.
git checkout master
echo "Pulling changes from remote repo"
git pull
echo "Updating IDEA configuration"
cp -R .idea ..
echo "Updating Contributor's Guide"
cp CONTRIBUTING.md ..
echo "Updating Contributor Covenant"
cp CODE_OF_CONDUCT.md ..
echo "Updating Codecov settings"
cp .codecov.yml ..
# Copies the file or directory passed as the first parameter to the upper directory,
# only if such a file or directory does not exist there.
function initialize() {
if [ ! -e ../"$1" ]; then
echo "Creating $1"
cp -R "$1" ..
fi
}
initialize .gitattributes
initialize .gitignore
initialize .github
# Update existing workflows with more recent versions
echo "Updating GitHub workflows"
cp -a .github-workflows/. ../.github/workflows
cp -a .github/workflows/. ../.github/workflows
rm -f ../.github/workflows/detekt-code-analysis.yml # This one is `config`-only workflow.
# echo "Cleaning up GitHub workflows"
#rm -f ../buildSrc/src/main/kotlin/force-jacoco.gradle.kts
#rm -f ../buildSrc/src/main/kotlin/deps-between-tasks.kt
# echo "Cleaning up Gradle 'buildSrc' scripts"
#rm -f ../buildSrc/src/main/kotlin/force-jacoco.gradle.kts
#rm -f ../buildSrc/src/main/kotlin/deps-between-tasks.kt
# 2024-10-28
echo "Removing old packages under 'buildSrc/src/main/kotin/'"
rm -r ../buildSrc/src/main/kotlin/io/spine/internal/
echo "Cleaning up outdated dependency objects in 'buildSrc'"
# 2024-10-26, remove outdated files.
rm -f ../buildSrc/src/main/kotlin/io/spine/internal/dependency/McJava.kt
rm -f ../buildSrc/src/main/kotlin/io/spine/internal/dependency/ProtoData.kt
rm -f ../buildSrc/src/main/kotlin/io/spine/internal/dependency/ProtoTap.kt
rm -f ../buildSrc/src/main/kotlin/io/spine/internal/dependency/Spine.kt
rm -f ../buildSrc/src/main/kotlin/io/spine/internal/dependency/Validation.kt
# 2023-04-13, remove outdated files.
rm -f ../buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/Artifacts.kt
rm -f ../buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/dokka/DokkaExtensions.kt
rm -f ../buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/dokka/TaskContainerExtensions.kt
rm -f ../buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/publish/DokkaJar.kt
rm -f ../buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/publish/ProtoJar.kt
rm -f ../buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/publish/TestJar.kt
rm -f ../buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/publish/PublishingConfig.kt
rm -f ../buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/publish/Tasks.kt
# 2023-05-20, remove outdated files.
rm -f ../buildSrc/src/main/kotlin/io/spine/internal/gradle/publish/DependencyResolution.kt
# 2023-07-12, remove outdated files.
rm -f ../buildSrc/src/main/kotlin/java-module.gradle.kts
rm -f ../buildSrc/src/main/kotlin/kotlin-jvm-module.gradle.kts
rm -f ../buildSrc/src/main/kotlin/jacoco-kmm-jvm.gradle.kts
rm -f ../buildSrc/src/main/kotlin/io/spine/internal/gradle/DependencyResolution.kt
rm -f ../buildSrc/src/main/kotlin/Repositories.kt
# 2023-07-30, remove outdated files.
rm -f ../.lift.toml
# 2023-11-24, remove `license-report.md` in favor of `dependencies.md`
# See `config#498` for more.
rm -f ../license-report.md
echo "Updating Gradle 'buildSrc' scripts"
cp -R buildSrc ..
echo "Updating Gradle Wrapper"
cp -R ./gradle ..
cp gradlew ..
cp gradlew.bat ..
cd ..
echo "Adding 'buildSrc' sources to Git..."
git add ./buildSrc/src
echo "Done."