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
516cd43b
Commit
516cd43b
authored
Mar 05, 2019
by
ZhengCornell
Committed by
Evan W. Patton
Mar 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move shared constants from Compiler and ComponentListGenerator into ComponentDescriptorConstants
parent
6f939f64
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
89 deletions
+78
-89
appinventor/buildserver/build.xml
appinventor/buildserver/build.xml
+1
-0
appinventor/buildserver/src/com/google/appinventor/buildserver/Compiler.java
...rver/src/com/google/appinventor/buildserver/Compiler.java
+30
-62
appinventor/components/src/com/google/appinventor/components/common/ComponentDescriptorConstants.java
...entor/components/common/ComponentDescriptorConstants.java
+35
-0
appinventor/components/src/com/google/appinventor/components/scripts/ComponentListGenerator.java
...ppinventor/components/scripts/ComponentListGenerator.java
+12
-27
No files found.
appinventor/buildserver/build.xml
View file @
516cd43b
...
@@ -161,6 +161,7 @@
...
@@ -161,6 +161,7 @@
<fileset
dir=
"${local.lib.dir}"
includes=
"*.jar"
/>
<fileset
dir=
"${local.lib.dir}"
includes=
"*.jar"
/>
<fileset
dir=
"${build.dir}"
includes=
"common/CommonUtils.jar"
/>
<fileset
dir=
"${build.dir}"
includes=
"common/CommonUtils.jar"
/>
<fileset
dir=
"${build.dir}"
includes=
"common/CommonVersion.jar"
/>
<fileset
dir=
"${build.dir}"
includes=
"common/CommonVersion.jar"
/>
<fileset
dir=
"${build.dir}"
includes=
"components/CommonConstants.jar"
/>
<fileset
dir=
"${lib.dir}"
includes=
"bouncycastle/bcprov-jdk15on-149.jar"
/>
<fileset
dir=
"${lib.dir}"
includes=
"bouncycastle/bcprov-jdk15on-149.jar"
/>
<fileset
dir=
"${lib.dir}"
includes=
"bouncycastle/bcpkix-jdk15on-149.jar"
/>
<fileset
dir=
"${lib.dir}"
includes=
"bouncycastle/bcpkix-jdk15on-149.jar"
/>
<fileset
dir=
"${lib.dir}"
includes=
"android/tools/common-24.3.0.jar"
/>
<fileset
dir=
"${lib.dir}"
includes=
"android/tools/common-24.3.0.jar"
/>
...
...
appinventor/buildserver/src/com/google/appinventor/buildserver/Compiler.java
View file @
516cd43b
This diff is collapsed.
Click to expand it.
appinventor/components/src/com/google/appinventor/components/common/ComponentDescriptorConstants.java
0 → 100644
View file @
516cd43b
// -*- mode: java; c-basic-offset: 2; -*-
// Copyright 2011-2019 MIT, All rights reserved
// Released under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0
package
com.google.appinventor.components.common
;
/**
* Contains constants related to the description of Simple components.
*
*/
public
final
class
ComponentDescriptorConstants
{
private
ComponentDescriptorConstants
()
{
// nothing
}
// shared constants between ComponentListGenerator.java and Compiler.java
public
static
final
String
ARMEABI_V7A_SUFFIX
=
"-v7a"
;
public
static
final
String
ARM64_V8A_SUFFIX
=
"-v8a"
;
public
static
final
String
X86_64_SUFFIX
=
"-x8a"
;
public
static
final
String
ASSET_DIRECTORY
=
"component"
;
public
static
final
String
ASSETS_TARGET
=
"assets"
;
public
static
final
String
ACTIVITIES_TARGET
=
"activities"
;
public
static
final
String
LIBRARIES_TARGET
=
"libraries"
;
public
static
final
String
NATIVE_TARGET
=
"native"
;
public
static
final
String
PERMISSIONS_TARGET
=
"permissions"
;
public
static
final
String
BROADCAST_RECEIVERS_TARGET
=
"broadcastReceivers"
;
public
static
final
String
ANDROIDMINSDK_TARGET
=
"androidMinSdk"
;
public
static
final
String
CONDITIONALS_TARGET
=
"conditionals"
;
// TODO(Will): Remove the following target once the deprecated
// @SimpleBroadcastReceiver annotation is removed. It should
// should remain for the time being because otherwise we'll break
// extensions currently using @SimpleBroadcastReceiver.
public
static
final
String
BROADCAST_RECEIVER_TARGET
=
"broadcastReceiver"
;
}
appinventor/components/src/com/google/appinventor/components/scripts/ComponentListGenerator.java
View file @
516cd43b
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
package
com.google.appinventor.components.scripts
;
package
com.google.appinventor.components.scripts
;
import
com.google.appinventor.common.utils.StringUtils
;
import
com.google.appinventor.common.utils.StringUtils
;
import
com.google.appinventor.components.common.ComponentDescriptorConstants
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.Writer
;
import
java.io.Writer
;
...
@@ -23,22 +24,6 @@ import javax.tools.FileObject;
...
@@ -23,22 +24,6 @@ import javax.tools.FileObject;
* @author lizlooney@google.com (Liz Looney)
* @author lizlooney@google.com (Liz Looney)
*/
*/
public
final
class
ComponentListGenerator
extends
ComponentProcessor
{
public
final
class
ComponentListGenerator
extends
ComponentProcessor
{
// Names of component information types to be output. Must match buildserver.compiler constants.
private
static
final
String
PERMISSIONS_TARGET
=
"permissions"
;
private
static
final
String
LIBRARIES_TARGET
=
"libraries"
;
private
static
final
String
ASSETS_TARGET
=
"assets"
;
private
static
final
String
NATIVE_TARGET
=
"native"
;
private
static
final
String
BROADCAST_RECEIVERS_TARGET
=
"broadcastReceivers"
;
private
static
final
String
ACTIVITIES_TARGET
=
"activities"
;
private
static
final
String
ANDROIDMINSDK_TARGET
=
"androidMinSdk"
;
private
static
final
String
CONDITONAL_TARGET
=
"conditional"
;
// TODO(Will): Remove the following target once the deprecated
// @SimpleBroadcastReceiver annotation is removed. It should
// should remain for the time being because otherwise we'll break
// extensions currently using @SimpleBroadcastReceiver.
private
static
final
String
BROADCAST_RECEIVER_TARGET
=
"broadcastReceiver"
;
// Where to write results. Build Info is the collection of permissions, asset and library info.
// Where to write results. Build Info is the collection of permissions, asset and library info.
private
static
final
String
COMPONENT_LIST_OUTPUT_FILE_NAME
=
"simple_components.txt"
;
private
static
final
String
COMPONENT_LIST_OUTPUT_FILE_NAME
=
"simple_components.txt"
;
private
static
final
String
COMPONENT_BUILD_INFO_OUTPUT_FILE_NAME
=
private
static
final
String
COMPONENT_BUILD_INFO_OUTPUT_FILE_NAME
=
...
@@ -91,19 +76,19 @@ public final class ComponentListGenerator extends ComponentProcessor {
...
@@ -91,19 +76,19 @@ public final class ComponentListGenerator extends ComponentProcessor {
private
static
void
outputComponentBuildInfo
(
ComponentInfo
component
,
StringBuilder
sb
)
{
private
static
void
outputComponentBuildInfo
(
ComponentInfo
component
,
StringBuilder
sb
)
{
sb
.
append
(
"{\"type\": \""
);
sb
.
append
(
"{\"type\": \""
);
sb
.
append
(
component
.
type
).
append
(
"\""
);
sb
.
append
(
component
.
type
).
append
(
"\""
);
appendComponentInfo
(
sb
,
PERMISSIONS_TARGET
,
component
.
permissions
);
appendComponentInfo
(
sb
,
ComponentDescriptorConstants
.
PERMISSIONS_TARGET
,
component
.
permissions
);
appendComponentInfo
(
sb
,
LIBRARIES_TARGET
,
component
.
libraries
);
appendComponentInfo
(
sb
,
ComponentDescriptorConstants
.
LIBRARIES_TARGET
,
component
.
libraries
);
appendComponentInfo
(
sb
,
NATIVE_TARGET
,
component
.
nativeLibraries
);
appendComponentInfo
(
sb
,
ComponentDescriptorConstants
.
NATIVE_TARGET
,
component
.
nativeLibraries
);
appendComponentInfo
(
sb
,
ASSETS_TARGET
,
component
.
assets
);
appendComponentInfo
(
sb
,
ComponentDescriptorConstants
.
ASSETS_TARGET
,
component
.
assets
);
appendComponentInfo
(
sb
,
ACTIVITIES_TARGET
,
component
.
activities
);
appendComponentInfo
(
sb
,
ComponentDescriptorConstants
.
ACTIVITIES_TARGET
,
component
.
activities
);
appendComponentInfo
(
sb
,
ANDROIDMINSDK_TARGET
,
Collections
.
singleton
(
Integer
.
toString
(
component
.
getAndroidMinSdk
())));
appendComponentInfo
(
sb
,
ComponentDescriptorConstants
.
ANDROIDMINSDK_TARGET
,
Collections
.
singleton
(
Integer
.
toString
(
component
.
getAndroidMinSdk
())));
appendComponentInfo
(
sb
,
BROADCAST_RECEIVERS_TARGET
,
component
.
broadcastReceivers
);
appendComponentInfo
(
sb
,
ComponentDescriptorConstants
.
BROADCAST_RECEIVERS_TARGET
,
component
.
broadcastReceivers
);
appendConditionalComponentInfo
(
component
,
sb
);
appendConditionalComponentInfo
(
component
,
sb
);
// TODO(Will): Remove the following call once the deprecated
// TODO(Will): Remove the following call once the deprecated
// @SimpleBroadcastReceiver annotation is removed. It should
// @SimpleBroadcastReceiver annotation is removed. It should
// should remain for the time being because otherwise we'll break
// should remain for the time being because otherwise we'll break
// extensions currently using @SimpleBroadcastReceiver.
// extensions currently using @SimpleBroadcastReceiver.
appendComponentInfo
(
sb
,
BROADCAST_RECEIVER_TARGET
,
component
.
classNameAndActionsBR
);
appendComponentInfo
(
sb
,
ComponentDescriptorConstants
.
BROADCAST_RECEIVER_TARGET
,
component
.
classNameAndActionsBR
);
sb
.
append
(
"}"
);
sb
.
append
(
"}"
);
}
}
...
@@ -119,10 +104,10 @@ public final class ComponentListGenerator extends ComponentProcessor {
...
@@ -119,10 +104,10 @@ public final class ComponentListGenerator extends ComponentProcessor {
component
.
conditionalBroadcastReceivers
.
size
()
==
0
)
{
component
.
conditionalBroadcastReceivers
.
size
()
==
0
)
{
return
;
return
;
}
}
sb
.
append
(
", \"
conditionals
\": { "
);
sb
.
append
(
", \"
"
+
ComponentDescriptorConstants
.
CONDITIONALS_TARGET
+
"
\": { "
);
sb
.
append
(
"\"
permissions
\": "
);
sb
.
append
(
"\"
"
+
ComponentDescriptorConstants
.
PERMISSIONS_TARGET
+
"
\": "
);
appendMap
(
sb
,
component
.
conditionalPermissions
);
appendMap
(
sb
,
component
.
conditionalPermissions
);
sb
.
append
(
", \"
broadcastReceivers
\": "
);
sb
.
append
(
", \"
"
+
ComponentDescriptorConstants
.
BROADCAST_RECEIVERS_TARGET
+
"
\": "
);
appendMap
(
sb
,
component
.
conditionalBroadcastReceivers
);
appendMap
(
sb
,
component
.
conditionalBroadcastReceivers
);
sb
.
append
(
"}"
);
sb
.
append
(
"}"
);
}
}
...
...
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