Skip to content

Commit 0c19ff5

Browse files
committed
πŸ“š Restructure and enhance Gradle documentation with comprehensive README
1 parent 40d8933 commit 0c19ff5

File tree

6 files changed

+776
-493
lines changed

6 files changed

+776
-493
lines changed

β€Ž.gradle-docs/BUILD.mdβ€Ž

Lines changed: 117 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,46 +8,51 @@ This module uses a pure Gradle build system. The build process downloads phpMyAd
88

99
### Version Folder Inclusion
1010

11-
When building a release, the build system **includes the version folder** in the compressed archive. This is consistent with other Bearsampp modules (e.g., module-bruno).
11+
When building a release, the build system **includes the version folder** in the compressed archive. This is consistent with other Bearsampp modules (e.g., module-bruno, module-php).
1212

1313
**Example structure in the final archive:**
1414
```
1515
phpmyadmin5.2.1/
1616
β”œβ”€β”€ bearsampp.conf
1717
β”œβ”€β”€ config.inc.php
18+
β”œβ”€β”€ index.php
1819
└── [phpMyAdmin files]
1920
```
2021

2122
### How It Works
2223

23-
1. **Bundle Folder Naming**: The `${bundle.folder}` variable is derived from the bundle path and includes the version:
24+
1. **Bundle Folder Naming**: The bundle folder is derived from the bundle path and includes the version:
2425
- Example: `phpmyadmin5.2.1`
2526

26-
2. **Preparation Directory**: Files are copied to `${bundle.tmp.prep.path}/${bundle.folder}`:
27-
- This creates: `tmp/phpmyadmin5.2.1/[files]`
27+
2. **Preparation Directory**: Files are copied to `${bundleTmpPrepPath}/${bundleName}${bundleVersion}`:
28+
- This creates: `tmp/bundles_prep/apps/phpmyadmin/phpmyadmin5.2.1/[files]`
2829

29-
3. **Compression**: The build system compresses the entire folder structure, preserving the version folder:
30+
3. **Compression**: The build system compresses from the parent directory, preserving the version folder:
3031
- Archive contains: `phpmyadmin5.2.1/` as the root directory
3132

3233
### Build Process Flow
3334

34-
1. **Version Validation**: Checks if the specified version exists in `bin/` directory
35+
1. **Version Validation**: Checks if the specified version exists in `bin/` or `bin/archived/` directory
3536
2. **Preparation**: Creates temporary directory structure with version folder name
3637
3. **Download**: Fetches phpMyAdmin from:
3738
- modules-untouched repository (primary)
3839
- releases.properties (fallback)
3940
- Standard URL format (final fallback)
4041
4. **Extraction**: Extracts phpMyAdmin archive using 7-Zip
4142
5. **Configuration**: Copies custom configuration files from `bin/[version]/`
42-
6. **Archiving**: Creates 7z archive with version folder included
43-
7. **Hashing**: Generates MD5, SHA1, SHA256, and SHA512 hash files
43+
6. **Build Copy**: Copies to bundles_build directory (uncompressed for development/testing)
44+
7. **Archiving**: Creates 7z archive with version folder included
45+
8. **Hashing**: Generates MD5, SHA1, SHA256, and SHA512 hash files
4446

4547
## Building a Release
4648

4749
### Using Gradle
4850

4951
```bash
50-
# Build a specific version
52+
# Build a specific version (interactive mode)
53+
gradle release
54+
55+
# Build a specific version (non-interactive mode)
5156
gradle release -PbundleVersion=5.2.1
5257

5358
# Build all available versions
@@ -67,7 +72,7 @@ gradle info
6772

6873
### Supported Versions
6974

70-
Versions are defined in `releases.properties`. Each entry maps a version to its download URL:
75+
Versions are defined in `releases.properties` and can also be fetched from the modules-untouched repository. Each entry maps a version to its download URL:
7176

7277
```properties
7378
5.2.1 = https://files.phpmyadmin.net/phpMyAdmin/5.2.1/phpMyAdmin-5.2.1-all-languages.7z
@@ -76,7 +81,7 @@ Versions are defined in `releases.properties`. Each entry maps a version to its
7681

7782
### Version Folder Structure
7883

79-
Each version has its own folder in `bin/`:
84+
Each version has its own folder in `bin/` or `bin/archived/`:
8085

8186
```
8287
bin/
@@ -86,9 +91,10 @@ bin/
8691
β”œβ”€β”€ phpmyadmin5.2.0/
8792
β”‚ β”œβ”€β”€ bearsampp.conf
8893
β”‚ └── config.inc.php
89-
└── phpmyadmin4.9.10/
90-
β”œβ”€β”€ bearsampp.conf
91-
└── config.inc.php
94+
└── archived/
95+
└── phpmyadmin4.9.10/
96+
β”œβ”€β”€ bearsampp.conf
97+
└── config.inc.php
9298
```
9399

94100
## Configuration Files
@@ -106,7 +112,7 @@ bundle.format = 7z
106112

107113
### releases.properties
108114

109-
Maps versions to download URLs for phpMyAdmin releases.
115+
Maps versions to download URLs for phpMyAdmin releases. This serves as a local fallback when the modules-untouched repository is unavailable.
110116

111117
## Archive Format
112118

@@ -117,25 +123,26 @@ phpmyadmin[VERSION]/
117123
β”œβ”€β”€ bearsampp.conf # Bearsampp configuration
118124
β”œβ”€β”€ config.inc.php # phpMyAdmin configuration
119125
β”œβ”€β”€ index.php # phpMyAdmin entry point
120-
β”œβ”€β”€ [all phpMyAdmin files] # Complete phpMyAdmin installation
121-
└── ...
126+
β”œβ”€β”€ libraries/ # phpMyAdmin libraries
127+
β”œβ”€β”€ themes/ # phpMyAdmin themes
128+
└── [all phpMyAdmin files] # Complete phpMyAdmin installation
122129
```
123130

124131
## Comparison with Other Modules
125132

126133
This build structure is consistent with other Bearsampp modules:
127134

128135
- **module-bruno**: Uses pure Gradle build with version folder inclusion
136+
- **module-php**: Uses pure Gradle build with version folder inclusion
129137
- **module-apache**: Uses similar pattern with version folder inclusion
130-
- **module-php**: Uses similar pattern with version folder inclusion
131138

132139
All modules ensure the version folder is included in the compressed archive for proper organization and version management within Bearsampp.
133140

134141
## Key Features
135142

136143
### Pure Gradle Implementation
137144

138-
- No Ant dependencies required
145+
- No external dependencies required (except 7-Zip for compression)
139146
- Modern build system with caching and incremental builds
140147
- Parallel execution support
141148
- Better IDE integration
@@ -150,24 +157,54 @@ The build system automatically downloads phpMyAdmin releases from:
150157
### Version Folder Inclusion
151158

152159
**Critical**: The build system ensures the version folder is included in the archive. This is verified by:
153-
- Creating prep directory with version folder: `tmp/prep/phpmyadmin5.2.1/`
160+
- Creating prep directory with version folder: `tmp/bundles_prep/apps/phpmyadmin/phpmyadmin5.2.1/`
154161
- Archiving from parent directory to include folder structure
155162
- Final archive contains: `phpmyadmin5.2.1/[files]`
156163

157-
This matches the pattern used in module-bruno and ensures proper integration with Bearsampp.
164+
This matches the pattern used in module-bruno and module-php, ensuring proper integration with Bearsampp.
165+
166+
### Interactive and Non-Interactive Modes
167+
168+
The build system supports both interactive and non-interactive modes:
169+
170+
**Interactive Mode**:
171+
```bash
172+
gradle release
173+
```
174+
- Displays a menu of available versions
175+
- Allows selection by index or version string
176+
- Shows version locations (bin/ or bin/archived/)
177+
178+
**Non-Interactive Mode**:
179+
```bash
180+
gradle release -PbundleVersion=5.2.1
181+
```
182+
- Directly builds the specified version
183+
- Suitable for CI/CD pipelines
184+
- No user interaction required
185+
186+
### Build All Versions
187+
188+
Build all available versions with a single command:
189+
```bash
190+
gradle releaseAll
191+
```
192+
- Builds all versions found in bin/ and bin/archived/
193+
- Provides summary of successful and failed builds
194+
- Continues on error to build remaining versions
158195

159196
## Troubleshooting
160197

161198
### Version Folder Not Found
162199

163200
If you get an error about a missing version folder:
164201

165-
1. Check that the version exists in `bin/`:
202+
1. Check that the version exists in `bin/` or `bin/archived/`:
166203
```bash
167204
gradle listVersions
168205
```
169206

170-
2. Verify the version is defined in `releases.properties`:
207+
2. Verify the version is defined in `releases.properties` or modules-untouched:
171208
```bash
172209
gradle listReleases
173210
```
@@ -197,8 +234,8 @@ This checks for:
197234
To verify the version folder is included in the archive:
198235

199236
```bash
200-
# Extract and check structure
201-
7z l phpmyadmin5.2.1-2025.1.23.7z
237+
# List archive contents
238+
7z l bearsampp-phpmyadmin-5.2.1-2025.1.23.7z
202239

203240
# Should show:
204241
# phpmyadmin5.2.1/
@@ -207,20 +244,64 @@ To verify the version folder is included in the archive:
207244
# etc.
208245
```
209246

247+
### Download Issues
248+
249+
If phpMyAdmin download fails:
250+
251+
1. Check network connectivity
252+
2. Verify the version exists in modules-untouched:
253+
```bash
254+
gradle checkModulesUntouched
255+
```
256+
3. Add the version to `releases.properties` as a fallback
257+
4. The build system will automatically try multiple sources
258+
259+
### 7-Zip Not Found
260+
261+
If 7-Zip is not found:
262+
263+
1. Install 7-Zip from https://www.7-zip.org/
264+
2. Or set the `7Z_HOME` environment variable to your 7-Zip installation directory
265+
3. Verify installation:
266+
```bash
267+
gradle verify
268+
```
269+
270+
## Build Output Structure
271+
272+
### Temporary Build Files
273+
274+
Located in `bearsampp-build/tmp/`:
275+
276+
```
277+
bearsampp-build/tmp/
278+
β”œβ”€β”€ downloads/phpmyadmin/ # Downloaded archives (cached)
279+
β”‚ └── phpMyAdmin-5.2.1-all-languages.7z
280+
β”œβ”€β”€ extract/phpmyadmin/ # Temporary extraction
281+
β”‚ └── 5.2.1/
282+
β”œβ”€β”€ bundles_prep/apps/phpmyadmin/ # Prepared bundles
283+
β”‚ └── phpmyadmin5.2.1/
284+
└── bundles_build/apps/phpmyadmin/ # Final uncompressed output
285+
└── phpmyadmin5.2.1/
286+
```
287+
288+
### Final Archives
289+
290+
Located in `bearsampp-build/apps/phpmyadmin/{bundle.release}/`:
291+
292+
```
293+
bearsampp-build/apps/phpmyadmin/2025.1.23/
294+
β”œβ”€β”€ bearsampp-phpmyadmin-5.2.1-2025.1.23.7z
295+
β”œβ”€β”€ bearsampp-phpmyadmin-5.2.1-2025.1.23.7z.md5
296+
β”œβ”€β”€ bearsampp-phpmyadmin-5.2.1-2025.1.23.7z.sha1
297+
β”œβ”€β”€ bearsampp-phpmyadmin-5.2.1-2025.1.23.7z.sha256
298+
└── bearsampp-phpmyadmin-5.2.1-2025.1.23.7z.sha512
299+
```
300+
210301
## References
211302

212303
- [Bearsampp Project](https://github.com/bearsampp/bearsampp)
213304
- [module-bruno build.gradle](https://github.com/Bearsampp/module-bruno/blob/gradle-convert/build.gradle) - Reference implementation
305+
- [module-php build.gradle](https://github.com/Bearsampp/module-php/blob/gradle-convert/build.gradle) - Reference implementation
214306
- [phpMyAdmin Official Site](https://www.phpmyadmin.net/)
215307
- [Gradle Documentation](https://docs.gradle.org/)
216-
217-
## Migration from Ant
218-
219-
This module has been migrated from Ant to pure Gradle. Key changes:
220-
221-
- **No Ant import**: Pure Gradle implementation
222-
- **Simplified build**: Single build.gradle file
223-
- **Better performance**: Gradle caching and incremental builds
224-
- **Modern tooling**: Better IDE support and debugging
225-
226-
The build output and archive structure remain identical to the Ant version, ensuring backward compatibility with Bearsampp.

0 commit comments

Comments
Β (0)