This repository has been archived by the owner on Sep 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish every build to the Nightly channel
- Loading branch information
1 parent
d9d3bd5
commit a8e4120
Showing
9 changed files
with
135 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import re | ||
import subprocess | ||
from pathlib import Path | ||
from typing import cast | ||
|
||
|
||
_version = re.compile(r'^pluginVersion = (?P<version>.+)', re.M) | ||
|
||
|
||
def get_head_commit_hash() -> str: | ||
output = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']) | ||
return output.decode('ascii').strip() | ||
|
||
|
||
def get_nightly_version(content: str) -> str: | ||
head_commit_hash = get_head_commit_hash() | ||
|
||
version_line = cast(re.Match[str], _version.search(content)) | ||
current_version = version_line['version'] | ||
|
||
return f'{current_version}-{head_commit_hash}' | ||
|
||
|
||
def modify_content(content: str) -> tuple[str, str]: | ||
nightly_version = get_nightly_version(content) | ||
new_content = _version.sub( | ||
f'pluginVersion = {nightly_version}', | ||
content | ||
) | ||
|
||
return nightly_version, new_content | ||
|
||
|
||
def main(): | ||
gradle_properties = Path('gradle.properties') | ||
|
||
with open(gradle_properties, 'r') as file: | ||
content = file.read() | ||
|
||
with open(gradle_properties, 'w') as file: | ||
nightly_version, new_content = modify_content(content) | ||
file.write(new_content) | ||
|
||
print(nightly_version) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
## File icons | ||
|
||
In the [<i>Project</i> tool window][1], the icons for | ||
`uv.lock` and `uv.toml` files are replaced | ||
with uv logos. | ||
In the [<i>Project</i> tool window][1] and other places, | ||
the icons for `uv.lock` and `uv.toml` files are replaced with uv logos. | ||
|
||
|
||
[1]: https://www.jetbrains.com/help/pycharm/project-tool-window.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package insyncwithfoo.uv | ||
|
||
import com.intellij.openapi.project.Project | ||
import com.intellij.openapi.ui.Messages | ||
|
||
internal fun somethingIsWrong(title: String, message: String, project: Project? = null) { | ||
Messages.showErrorDialog(project, message, title) | ||
} | ||
|
||
internal fun somethingIsWrong(message: String, project: Project? = null) { | ||
somethingIsWrong(title = message("messages.somethingIsWrong.title"), message, project) | ||
} | ||
|
||
internal fun Project?.somethingIsWrong(title: String, message: String) { | ||
somethingIsWrong(title, message, project = this) | ||
} | ||
|
||
internal fun Project?.somethingIsWrong(message: String) { | ||
somethingIsWrong(message, project = this) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters