Skip to content

Instantly share code, notes, and snippets.

@Morteza-QN
Created June 14, 2024 15:56
Show Gist options
  • Save Morteza-QN/210d333d36c3302a7e46089f9162647c to your computer and use it in GitHub Desktop.
Save Morteza-QN/210d333d36c3302a7e46089f9162647c to your computer and use it in GitHub Desktop.
Package Hierarchy Guide
com.yourappname
├── data
│ ├── model
│ ├── repository
│ ├── network
│ └── database
├── ui
│ ├── activities
│ ├── fragments
│ ├── adapters
│ └── customviews
├── viewmodel
├── di
│ ├── components
│ ├── modules
│ └── scopes
├── util
└── app
----------------------------------
# Define the base directory for your project
$baseDir = "C:\path\to\your\project\com\yourappname"
# Define the directory structure
$directories = @(
"$baseDir\data\model",
"$baseDir\data\repository",
"$baseDir\data\network",
"$baseDir\data\database",
"$baseDir\ui\activities",
"$baseDir\ui\fragments",
"$baseDir\ui\adapters",
"$baseDir\ui\customviews",
"$baseDir\viewmodel",
"$baseDir\di\components",
"$baseDir\di\modules",
"$baseDir\di\scopes",
"$baseDir\util\helpers",
"$baseDir\app"
)
# Create the directories
foreach ($dir in $directories) {
if (-not (Test-Path -Path $dir)) {
New-Item -ItemType Directory -Path $dir -Force
Write-Output "Created directory: $dir"
} else {
Write-Output "Directory already exists: $dir"
}
}
Write-Output "Directory structure created successfully."
com.yourappname
├── model
├── view
│ ├── activities
│ ├── fragments
│ ├── adapters
│ └── customviews
├── viewmodel
├── repository
├── di
├── util
│ └── helpers
├── network
├── database
└── app
--------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment