Skip to content

Commit

Permalink
Update and rename README-2.md to README.md
Browse files Browse the repository at this point in the history
Added More info:
- Screenshots for reference
- Expected Output section
- Why this approach section 
- More clarity in certain sections
  • Loading branch information
niccolopaganini authored Sep 13, 2023
1 parent 16b6ba0 commit c118b01
Showing 1 changed file with 35 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,35 +41,48 @@ The above python scripts creates the following CSVs
| matching_entries | gets the matching packages |
| merged_output | gets the name of the packages, file location, and method name (as a whole) |

#### [Image 1 Below](#image-1-below)

![CSV_Directory](https://github.com/niccolopaganini/e-mission-phone-nvsr-iter1/blob/16b6ba09b3e6dc37e0927b6ff338400e3236e28b/bin/API_migration_scripts/screenshots/csv%20order.png)


Everything is executed through a shell script file called ```run_them_py_and_delete_em_csvs.sh```

They are executed in the above order and are created in the same. Although I am creating a bunch of CSVs, in the end, I am just saving ```output.csv```, ```matching_entries.csv```, and ```merged_output.csv``` and the rest are deleted; and ```merged_output.csv``` has the necessary information (More information below).

#### Image 2 Below

![CSV_Files_Importance](https://github.com/niccolopaganini/e-mission-phone-nvsr-iter1/blob/16b6ba09b3e6dc37e0927b6ff338400e3236e28b/bin/API_migration_scripts/screenshots/CSVs.png)

The process started from a jupyter notebook file ```Changes for script.ipynb``` which can be used for more information (if required) and the ```environment.yml``` holds the necessary dependencies.

The above served as the foundation but is now an outdated method
(The above served as the foundation but is now an outdated method)
## Setup/ How to run

### Setup
1. Navigate to the directory
__1. Navigate to the directory__
```
.../e-mission-phone/bin/API_Migration_scripts
```

2. Update the URL in ```classes.py``` & ```links.py```(if required)
**2. Update the URL in ```classes.py``` & ```links.py```(if required)**
```
classes.py -> url = "https://developer.android.com/sdk/api_diff/33/changes/alldiffs_index_changes" #URL from android website - only changes
```
```
links.py -> links = get_links("https://developer.android.com/sdk/api_diff/33/changes/alldiffs_index_changes")
```
(refer image_1 for more information if required)
_Link should look something like this:_
```
https://developer.android.com/sdk/api_diff/33/changes/alldiffs_index_changes
```

3. Update locations for ```output.py``` accordingly
**3. Update locations for ```output.py``` accordingly**
```
match_csv_java(".../e-mission-phone/plugins", ".../e-mission-phone/bin/API_Migration_scripts/simplify_classes.csv")
```
To be more precise, the first PATH will have to be your ```plugins``` directory and then second will be the PATH to ```simplify_classes.csv```. Techincally speaking, you can add leave it as ```simplify_classes.csv``` as all the files will be in the same directory ([image for reference](#image-1-below)).

__Once the setup process is done, run the following commands:__

The first command allows permissions to run
Expand All @@ -80,3 +93,19 @@ This command runs the shell script which in turn executes the python scripts
```
bash run_them_py_and_delete_em_csvs.sh
```
## Expected Output
Excepted Output will be a CSV file (```merged_output.csv```). The file opened in an excel will be in the following format:
```
<package/ class> | <File Location> | <Method name/ link>
```

For example:
```
content | /Users/nvsr/Downloads/e-mission-phone-nvsr-iter1-API_Migration_aid_script_patch-1/plugins/cordova-plugin-file/src/android/FileUtils.java | ../../../../reference/android/companion/CompanionDeviceManager.html#hasNotificationAccess(android.content.ComponentName)
```
I formatted it in this way because the method has the "full extension" so having the directory location in the middle can allow one to look at the classes on the left for a high level view and can scroll to the right for more information (basically quality of life from my perspective).

#### _Reasons why I didn't print changes_
1. The whole process on average took 4 minutes to run.
2. Quality of life - Looks more presentable/ easy to understand
3. Work span can take more time and this will have to be run just once. After that it's just you referring the CSV.

0 comments on commit c118b01

Please sign in to comment.