how do you specify the amper version? can you do i...
# kotlin-toolchain
b
how do you specify the amper version? can you do it in the module file?
j
It's present in the amper wrapper script at the root of your project. You can use
./amper update
to update the version and the script itself
It's not possible to have a different Amper version for each module, by the way. But in the future we might allow setting the version in the
project.yaml
b
ah, im use to setting gradle version in a config which forces it to dl a specific verison, it would be nice to include that option in yaml instead of editing the script file
j
How do you (personally) update Gradle? Do you use the
./gradlew wrapper
command?
If you edit
gradle-wrapper.properties
by hand, how do you maintain the checksum?
b
yea, i just edited the
.properties
file by hand when I need to update, i never use wrapper
not sure what you mean about checksum, i don't see one in the file
d
I do the same “just edit the .properties” 😅
😆 1
j
If you don't have a checksum in the Gradle wrapper properties file, it means your Gradle wrapper doesn't check the integrity of the Gradle distribution. Usually it's recommended to put the checksum there. This "unsafe"-ish mode without checksum is not supported in Amper - we always check the integrity. In that mode, in both Gradle and Amper you would have to update both the version and the checksum. This is doable by hand, but not very convenient. This is why the update command is usually preferable.
Note that you shouldn't edit the script file by hand in theory because it can change as well depending on the Amper version
b
that makes sense, but since the amper takes care of the checksum automatically when you run the cli, couldn't it do the same thing while reading the desired version from project.yml?
j
The difference is the moment at which you get the checksum. With the update command, you get the checksum at the moment you update (ideally in a network you trust), so that later when you actually try to build and download the distribution, you can compare the expected checksum with what you get from the distribution. If you retrieve the checksum at the same moment you check it, you can't really trust it. Someone tampering with your distribution download could also give you the checksum from the malicious distribution.
z
I'd also add that running
./gradlew wrapper
also updates the wrapper script itself over time. While the changes in there are probably not critical, you also don't get the latest version of the wrapper script if you just update the version in the properties file.
➕ 1