Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
appinventor-sources
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
appinventor-sources
Commits
13653adc
Unverified
Commit
13653adc
authored
Feb 20, 2020
by
Pavitra Golchha
Committed by
GitHub
Feb 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimise Pre-dexing (#2028)
parent
0097591e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
15 deletions
+17
-15
appinventor/buildserver/src/com/google/appinventor/buildserver/DexExecTask.java
...r/src/com/google/appinventor/buildserver/DexExecTask.java
+17
-15
No files found.
appinventor/buildserver/src/com/google/appinventor/buildserver/DexExecTask.java
View file @
13653adc
...
...
@@ -16,26 +16,25 @@
package
com.google.appinventor.buildserver
;
import
com.google.common.hash.HashCode
;
import
com.google.common.hash.HashFunction
;
import
com.google.common.hash.Hashing
;
import
java.io.File
;
import
java.io.IOException
;
import
java.nio.file.Files
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.
Iterator
;
import
java.util.
HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.HashMap
;
import
com.google.common.hash.HashCode
;
import
com.google.common.hash.HashFunction
;
import
com.google.common.hash.Hashing
;
/**
* Dex task, modified from the Android SDK to run in BuildServer.
* Custom task to execute dx while handling dependencies.
*/
public
class
DexExecTask
{
public
class
DexExecTask
{
private
String
mExecutable
;
private
String
mOutput
;
...
...
@@ -46,11 +45,12 @@ public class DexExecTask {
private
boolean
mDisableDexMerger
=
false
;
private
static
Map
<
String
,
String
>
alreadyChecked
=
new
HashMap
<
String
,
String
>();
private
static
Object
semaphore
=
new
Object
();
// Used to protect dex cache creation
private
static
final
Object
semaphore
=
new
Object
();
// Used to protect dex cache creation
/**
* Sets the value of the "executable" attribute.
*
* @param executable the value.
*/
public
void
setExecutable
(
String
executable
)
{
...
...
@@ -59,6 +59,7 @@ public class DexExecTask {
/**
* Sets the value of the "verbose" attribute.
*
* @param verbose the value.
*/
public
void
setVerbose
(
boolean
verbose
)
{
...
...
@@ -67,6 +68,7 @@ public class DexExecTask {
/**
* Sets the value of the "output" attribute.
*
* @param output the value.
*/
public
void
setOutput
(
String
output
)
{
...
...
@@ -79,6 +81,7 @@ public class DexExecTask {
/**
* Sets the value of the "nolocals" attribute.
*
* @param verbose the value.
*/
public
void
setNoLocals
(
boolean
nolocals
)
{
...
...
@@ -100,11 +103,10 @@ public class DexExecTask {
return
true
;
}
synchronized
(
semaphore
)
{
synchronized
(
semaphore
)
{
final
int
count
=
inputs
.
size
();
boolean
allSuccessful
=
true
;
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
File
input
=
inputs
.
get
(
i
);
if
(
input
.
isFile
())
{
// check if this libs needs to be pre-dexed
...
...
@@ -112,7 +114,7 @@ public class DexExecTask {
File
dexedLib
=
new
File
(
mDexedLibs
,
fileName
);
String
dexedLibPath
=
dexedLib
.
getAbsolutePath
();
if
(
dexedLib
.
isFile
()
==
false
/*||
if
(
!
dexedLib
.
isFile
()
/*||
dexedLib.lastModified() < input.lastModified()*/
)
{
System
.
out
.
println
(
...
...
@@ -123,8 +125,8 @@ public class DexExecTask {
dexedLib
.
delete
();
}
boolean
dexSuccess
=
runDx
(
input
,
dexedLibPath
,
false
/*showInput*/
);
allSuccessful
=
allSuccessful
&&
dexSuccess
;
boolean
dexSuccess
=
runDx
(
input
,
dexedLibPath
,
/*showInputs=*/
false
);
if
(!
dexSuccess
)
return
false
;
}
else
{
System
.
out
.
println
(
String
.
format
(
"Using Pre-Dexed %1$s <- %2$s"
,
...
...
@@ -135,7 +137,7 @@ public class DexExecTask {
inputs
.
set
(
i
,
dexedLib
);
}
}
return
allSuccessful
;
return
true
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment