New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(android): clean/rebuild should release gradle file locks #11712
Conversation
Tests:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR: PASS
From my previous comments, I believe my test project was in an initial bad state. Subsequent builds are successful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jquick-axway The first test seems to be fine but on the Module Clean Test
when I do a appc ti clean
I see the following error:
[DEBUG] Deleting C:\Users\APPC\Downloads\ti.imagefactory-stable\android\build
(node:28180) UnhandledPromiseRejectionWarning: Error: EBUSY: resource busy or locked, unlink 'C:\Users\APPC\Downloads\ti.imagefactory-stable\android\build\local.properties'
at Object.unlinkSync (fs.js:1052:3)
at rimrafSync (C:\ProgramData\Titanium\mobilesdk\win32\9.1.0\node_modules\fs-extra\lib\remove\rimraf.js:254:15)
at C:\ProgramData\Titanium\mobilesdk\win32\9.1.0\node_modules\fs-extra\lib\remove\rimraf.js:291:39
at Array.forEach (<anonymous>)
at rmkidsSync (C:\ProgramData\Titanium\mobilesdk\win32\9.1.0\node_modules\fs-extra\lib\remove\rimraf.js:291:26)
at rmdirSync (C:\ProgramData\Titanium\mobilesdk\win32\9.1.0\node_modules\fs-extra\lib\remove\rimraf.js:281:7)
at Object.rimrafSync [as removeSync] (C:\ProgramData\Titanium\mobilesdk\win32\9.1.0\node_modules\fs-extra\lib\remove\rimraf.js:252:7)
at C:\ProgramData\Titanium\mobilesdk\win32\9.1.0\android\cli\commands\_cleanModule.js:42:7
at Array.forEach (<anonymous>)
at Object.run (C:\ProgramData\Titanium\mobilesdk\win32\9.1.0\android\cli\commands\_cleanModule.js:38:11)
(node:28180) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:28180) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Test Environment
Operating System
Name = Microsoft Windows 10 Pro
Version = 10.0.18363
Architecture = 64bit
# CPUs = 4
Memory = 32.0GB
Node.js
Node.js Version = 12.16.1
npm Version = 6.13.4
Appcelerator CLI
Installer = 5.0.0
Core Package = 8.0.0
Titanium CLI
CLI Version = 5.2.2
node-appc Version = 0.2.49
Java Development Kit
Version = 10.0.1_10
Updated PR:
|
@jquick-axway The Hyperloop app is running fine but when cleaning ti.image factory I get the following error (although the build folder empties)
|
The Edit: |
@ewanharris is going to take over this PR from here. He is going to look into deleting all files under the "build" directory except for the log file since the CLI is actively writing to it. Meaning that a "clean" will no longer completely delete the "build" folder anymore. We might also make a CLI "clean" change as well. Stay tuned! |
- Gradle daemon file locks prevented some build files from being deleted on Windows. - Modified app rebuild to run gradle "clean" task or "stop" gradle deamon as a fallback. * Titanium 7.x.x and 8.x.x has gradlew files for proguard, but cannot run "clean" due to missing project files. - Modified module clean to run gradle "clean" task. - Modified hyperloop to v5.0.4 to run gradle "clean" task.
- No longer running gradle "clean" task since it doesn't release lock on "local.properties" file. Stopping daemon seems to be the only solution. - Modified module clean to delete all files/folders async.
- The 5.0.4 change is not needed on Android for TIMOB-27882.
On Windows as we were trying to write to the log file and remove it at the same time this would cause an error
@ssjsamir The issue around cleaning a module should now be resolved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FR Passed: Tested using the two test cases mentioned in the Description above.
Test Environment
Operating System
Name = Microsoft Windows 10 Pro
Version = 10.0.18363
Architecture = 64bit
CPUs = 4
Memory = 31.9GB
Node.js
Node.js Version = 12.16.1
npm Version = 6.13.4
Appcelerator CLI
Installer = 5.0.0
Core Package = 8.0.0
Titanium CLI
CLI Version = 5.2.2
node-appc Version = 0.2.49
Java Development Kit
Version = 10.0.1_10
Java Home = C:\Program Files\Java\jdk-10.0.1
NDK Version : 20.1.5948944
JIRA:
https://jira.appcelerator.org/browse/TIMOB-27882
Summary:
Hyperloop App Test:
<module>hyperloop</module>
9.0.1.GA
for Android.8.3.1.GA
for Android.Module Clean Test:
.\ti.imagefactory\android
appc ti sdk select <sdk-version>
(Enter this PR's SDK version.)appc run -p android --build-only
appc ti clean
.\android\build
and.\android\dist
appc run -p android