Skip to content

Commit 6bcebc7

Browse files
authored
bump some versions and write contributing guide (#135)
1 parent 536179c commit 6bcebc7

File tree

9 files changed

+135
-42
lines changed

9 files changed

+135
-42
lines changed

CONTRIBUTING.md

Lines changed: 96 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,101 @@
11
# Contributing
22

3-
## Creating issues
3+
## Find or file an issue to work on
44

5-
If you notice a discrepancy between PokeAPI's responses and PokeKotlin's object
6-
models, you should create an issue and I'll fix it as soon as possible. You can
7-
also post questions, feature suggestions, general support issues, or anything
8-
else.
5+
If you're looking to add a feature or fix a bug and there's no issue filed yet,
6+
it's good to
7+
[file an issue](https://github.com/pokeapi/pokekotlin/issues/new/choose) first
8+
to have a discussion about the change before you start working on it.
99

10-
## Submitting changes
10+
If you're new and looking for things to contribute, see our
11+
[good first issue](https://github.com/pokeapi/pokekotlin/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22good%20first%20issue%22)
12+
label. These issues are usually ready to work on and don't require deep
13+
knowledge of the library's internals.
1114

12-
Remember to always work in a separate branch, use descriptive commit messages,
13-
and use pull requests to submit your changes. Always create an issue and mention
14-
you're working on something first. Also, make sure that all tests pass. If you
15-
add new fields or types, write the tests to check them against PokeAPI.
15+
## Development Environment Setup
16+
17+
### Prerequisites
18+
19+
1. **IDE**: [IntelliJ IDEA](https://www.jetbrains.com/idea/) is recommended.
20+
VSCode and other editors won't work well, as this is a Kotlin project and
21+
there's not yet a stable LSP for Kotlin.
22+
2. **Node.js**: Required for running the test server. Instructions can be found
23+
at [nodejs.org](https://nodejs.org/en/download).
24+
3. **Just** (optional): A command runner that simplifies running common tasks.
25+
Installation instructions can be found at
26+
[just.systems](https://just.systems/man/en/).
27+
28+
### Cloning the Repository
29+
30+
This repository uses a Git submodule for test data. When cloning, make sure to
31+
include the `--recurse-submodules` flag:
32+
33+
```bash
34+
git clone --recurse-submodules 'https://github.com/PokeAPI/pokekotlin.git'
35+
```
36+
37+
If you've already cloned the repository without submodules, you can initialize
38+
them with:
39+
40+
```bash
41+
git submodule update --init --recursive
42+
```
43+
44+
### IDE Setup
45+
46+
1. Open the project in IntelliJ IDEA or similar IDE.
47+
2. Make sure you have the Kotlin Multiplatform plugin installed. This should be
48+
included by default in recent versions of IntelliJ IDEA and Android Studio.
49+
3. For more information on setting up Kotlin Multiplatform, refer to the
50+
[official Kotlin Multiplatform documentation](https://kotlinlang.org/docs/multiplatform-get-started.html).
51+
52+
## Running Tests
53+
54+
Most tests in this project rely on a local server that serves the PokeAPI data
55+
from static files. The server needs to be running before executing the tests.
56+
57+
### Starting the Test Server
58+
59+
You can start the test server using the provided script:
60+
61+
```bash
62+
./scripts/test-server
63+
```
64+
65+
Or if you have Just installed, you can use:
66+
67+
```bash
68+
just test-server
69+
```
70+
71+
### Running Tests
72+
73+
The project includes tests for various platforms. You can run them using Gradle
74+
directly or through the Just commands. For details on available commands, see
75+
the [`justfile`](./justfile) in the project root or run:
76+
77+
```bash
78+
just
79+
```
80+
81+
## Code Formatting
82+
83+
The project uses Spotless for code formatting. You can apply the formatting
84+
rules with:
85+
86+
```bash
87+
just format
88+
```
89+
90+
Or using Gradle directly:
91+
92+
```bash
93+
./gradlew spotlessApply
94+
```
95+
96+
If you'd prefer to apply automatically on commit, opt in to the pre-commit hook
97+
with:
98+
99+
```bash
100+
./gradlew installGitHooks
101+
```

gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ org.gradle.configuration-cache=false
99
org.gradle.jvmargs=-Xmx4096M -Dfile.encoding=UTF-8
1010
android.nonTransitiveRClass=true
1111
android.useAndroidX=true
12-
android.experimental.lint.version=8.8.2

gradle/libs.versions.toml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
[versions]
22
androidx-activity = "1.10.1"
3-
androidx-navigation = "2.9.0-beta02"
3+
androidx-navigation = "2.9.0-beta03"
44
kotlinx-coroutines = "1.10.2"
5-
kotlinx-io = "0.7.0"
5+
kotlinx-io = "0.8.0"
66
kotlinx-serialization = "1.8.1"
7-
ktor = "3.1.3"
7+
ktor = "3.2.0"
88

9-
gradle-android = "8.7.2"
10-
gradle-compose = "1.8.1"
11-
gradle-kotlin = "2.1.21"
9+
# Upgrade these in sync, also Gradle and JDK
10+
gradle-kotlin = "2.2.0"
11+
gradle-android = "8.10.0"
12+
gradle-suspendTransformCompiler = "2.2.0-0.13.1"
13+
14+
gradle-compose = "1.8.2"
1215
gradle-dokka = "2.0.0"
1316
gradle-jgitver = "0.10.0-rc03"
14-
gradle-mavenPublish = "0.32.0"
17+
gradle-mavenPublish = "0.33.0"
1518
gradle-mkdocs = "4.0.1"
1619
gradle-spotless = "7.0.4"
17-
gradle-suspendTransformCompiler = "2.1.20-0.12.0"
18-
tool-prettier = "3.5.3"
20+
tool-prettier = "3.6.2"
21+
22+
# Don't forget to check settings.gradle for more versions
1923

2024
[libraries]
2125
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity" }

gradle/wrapper/gradle-wrapper.jar

-14.6 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -55,7 +57,7 @@
5557
# Darwin, MinGW, and NonStop.
5658
#
5759
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5961
# within the Gradle project.
6062
#
6163
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,7 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
8890

8991
# Use the maximum available, or set MAX_FD != -1 to use that value.
9092
MAX_FD=maximum
@@ -112,7 +114,7 @@ case "$( uname )" in #(
112114
NONSTOP* ) nonstop=true ;;
113115
esac
114116

115-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
117+
CLASSPATH="\\\"\\\""
116118

117119

118120
# Determine the Java command to use to start the JVM.
@@ -203,15 +205,15 @@ fi
203205
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204206

205207
# Collect all arguments for the java command:
206-
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
208+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207209
# and any embedded shellness will be escaped.
208210
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209211
# treated as '${Hostname}' itself on the command line.
210212

211213
set -- \
212214
"-Dorg.gradle.appname=$APP_BASE_NAME" \
213215
-classpath "$CLASSPATH" \
214-
org.gradle.wrapper.GradleWrapperMain \
216+
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
215217
"$@"
216218

217219
# Stop when "xargs" is not available.

gradlew.bat

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
4345
%JAVA_EXE% -version >NUL 2>&1
4446
if %ERRORLEVEL% equ 0 goto execute
4547

46-
echo.
47-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48-
echo.
49-
echo Please set the JAVA_HOME variable in your environment to match the
50-
echo location of your Java installation.
48+
echo. 1>&2
49+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
50+
echo. 1>&2
51+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
52+
echo location of your Java installation. 1>&2
5153

5254
goto fail
5355

@@ -57,22 +59,22 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5759

5860
if exist "%JAVA_EXE%" goto execute
5961

60-
echo.
61-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62-
echo.
63-
echo Please set the JAVA_HOME variable in your environment to match the
64-
echo location of your Java installation.
62+
echo. 1>&2
63+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
64+
echo. 1>&2
65+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
66+
echo location of your Java installation. 1>&2
6567

6668
goto fail
6769

6870
:execute
6971
@rem Setup the command line
7072

71-
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73+
set CLASSPATH=
7274

7375

7476
@rem Execute Gradle
75-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
77+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
7678

7779
:end
7880
@rem End local scope for the variables with windows NT shell

justfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ test-wasm-browser:
2929
test-wasm-node:
3030
./gradlew wasmNodeTest
3131

32-
native-desktop-task := (
32+
native-host-test-task := (
3333
if os() == "macos" { "macosArm64Test" }
3434
else if os() == "linux" { "linuxX64Test" }
3535
else if os() == "windows" { "mingwX64Test" }
3636
else { error("Unrecognized OS: " + os()) }
3737
)
3838

39-
test-native-desktop:
40-
./gradlew {{ native-desktop-task }}
39+
test-native-host:
40+
./gradlew {{ native-host-test-task }}
4141

4242
test-native-ios:
4343
./gradlew iosSimulatorArm64Test

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ dependencyResolutionManagement {
3131
}
3232
}
3333

34-
plugins { id("org.gradle.toolchains.foojay-resolver-convention") version ("0.10.0") }
34+
plugins { id("org.gradle.toolchains.foojay-resolver-convention") version ("1.0.0") }
3535

3636
include(":", ":demo-app")

0 commit comments

Comments
 (0)