CLI Tool for Sorting Android Studio Changelists
Project description
Changelist Sort
Making Sorting Changelist Files Easy!
- Close Android Studio (saves changelists to workspace file)
- Open shell from project root directory (or supply workspace file path in arguments)
- Run
changelist-sort(orcl-sort) add arguments/options if necessary - Reopen Android Studio. Your changelists are sorted.
Note: Add alias to your shell environment to maximize your efficiency.
Project Sorting Configuration
To configure a changelist sorting patterns for your project:
- Create Directory
.changelists/ - Create File
sort.xmlin Directory - Write Sorting XML Root Tag
<sorting></sorting> - Write Changelists Tags
<changelist name="" key=""></changelist> - Write File Pattern Tags
<files ... />
File Pattern Attributes
For each <files /> tag, apply ONE of the following attributes:
- file_ext : Match the file extension of the file. Do not include the dot.
- first_dir : The first directory in the path. Use empty string to match root directory.
- filename_prefix : The filename startswith this prefix.
- filename_suffix : The filename endswith this prefix.
- path_start : The beginning of the parent directory path. It's usually better to exclude unnecessary slash characters.
- path_end : The end of the parent directory path. It's usually better to exclude unnecessary slash characters.
Sorting Keys
The key attribute inside changelists is required.
- Sorting Keys are short, simple strings that identify a changelist.
- More than one Sorting Key can map to one Changelist.
- Every File pattern is associated with a Sorting Key.
Sorting By Module (default)
Files are sorted by the name of the top level directory they are located in. In Android projects, each directory in the project root is a module, with a few special cases.
Sorting By Source Set (Gradle, Android)
A specialized Module Sort mode that splits changes by their source set.
Apply the -s flag to use this sorting mode.
Special Changelists & Directories
There are special Changelists, and special Directories that are handled differently.
- Build Updates Changelist
- Root Directory
- Gradle Directory
Build Updates Changelist:
This is a changelist that is used to collect all of the files that affect the project build.
This includes all files in the gradle directory, and any file that ends with the .gradle file extension. There are also Gradle files that end in .properties, which are also sorted into the Build Updates Changelist.
Root Directory:
The Root directory is special because the file paths are really short and do not contain a module name. Often, Root directory contains .gradle files which are sorted into the Build Updates Changelist. Any non-Gradle files in the Root directory are sorted into a special Changelist that may be called Root or Project Root.
Gradle Directory:
The Gradle Directory is a direct descendant of the Root directory, and may contain toml, gradle, or properties files. These are all sorted into the Build Updates Changelist.
Module Names and Sorting Comparisons
Changelist Names The name of the changelist must match the module, ignoring letter case and removing spaces.
Otherwise, a new Changelist will be created that matches the module name.
- Underscores are replaced with spaces.
- Each Word in the Name will start with an uppercase letter.
Remove Empty Changelists
You can remove all empty changelists after a sort has completed by adding the -r flag, or --remove-empty argument.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file changelist_sort-0.4.1.tar.gz.
File metadata
- Download URL: changelist_sort-0.4.1.tar.gz
- Upload date:
- Size: 41.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8148bf65da7a3f015309acf29b669f8c5fd07abc04c18ea18c94ba1eace61a2c
|
|
| MD5 |
378ae578cbf0db8a6767b64222ee170b
|
|
| BLAKE2b-256 |
a0e1a16f87d46d4c93e63678cb8ff858468e2917a61a67b9970348ad0ca10e15
|
Provenance
The following attestation bundles were made for changelist_sort-0.4.1.tar.gz:
Publisher:
publish.yml on DK96-OS/changelist-sort
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
changelist_sort-0.4.1.tar.gz -
Subject digest:
8148bf65da7a3f015309acf29b669f8c5fd07abc04c18ea18c94ba1eace61a2c - Sigstore transparency entry: 154075344
- Sigstore integration time:
-
Permalink:
DK96-OS/changelist-sort@2a35c824afc93c5ea3c366cf52cd900fb1d7395a -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/DK96-OS
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2a35c824afc93c5ea3c366cf52cd900fb1d7395a -
Trigger Event:
release
-
Statement type:
File details
Details for the file changelist_sort-0.4.1-py3-none-any.whl.
File metadata
- Download URL: changelist_sort-0.4.1-py3-none-any.whl
- Upload date:
- Size: 55.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6aaf9bad75af368d4584a3cdeaaf8a4dc4ede2ea89789be5db581640bc20a5b1
|
|
| MD5 |
0e7bbacbb85081618fda61a35b56fe26
|
|
| BLAKE2b-256 |
b3ee2cb736ef9655120edad1614b4d65502d0e029b86322758257fe8556b01fd
|
Provenance
The following attestation bundles were made for changelist_sort-0.4.1-py3-none-any.whl:
Publisher:
publish.yml on DK96-OS/changelist-sort
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
changelist_sort-0.4.1-py3-none-any.whl -
Subject digest:
6aaf9bad75af368d4584a3cdeaaf8a4dc4ede2ea89789be5db581640bc20a5b1 - Sigstore transparency entry: 154075345
- Sigstore integration time:
-
Permalink:
DK96-OS/changelist-sort@2a35c824afc93c5ea3c366cf52cd900fb1d7395a -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/DK96-OS
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2a35c824afc93c5ea3c366cf52cd900fb1d7395a -
Trigger Event:
release
-
Statement type: