I want to represent current files structure in JSON or XML code but with some conditions.
- I want to my representation to not mention middle empty directories.
- I want to only list files ended with
Activity.*
For example: for this structure
my_project
├── feature1
│ └── src
│ └── java
│ └── com
│ └── directory
│ ├── MainActivity.kt
│ └── MainFragment.kt
└── feature2
└── src
└── java
└── com
└── directory
├── Feature2Activity.kt
└── Feature2Fragment.kt
Should generate
{
"my_project": {
"feature1": {
"directory": ["MainActivity"]
},
"feature2": {
"directory": ["Feature2Activity"]
}
}
}
It doesn't matter if I can't do this at runtime, think of it as a script that I will use on directory. Not at runtime of the App.