Skip to content

Commit 4dc179b

Browse files
committed
APL-CORE: December 2024 Release of APL 2024.3 compliant core engine (2024.3.0)
For more details on this release refer to CHANGELOG.md To learn about APL see: https://developer.amazon.com/docs/alexa-presentation-language/understand-apl.html
1 parent 6f7473d commit 4dc179b

File tree

273 files changed

+10927
-6097
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

273 files changed

+10927
-6097
lines changed

Diff for: CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## [2024.3]
4+
This release adds support for version 2024.3 of the APL specification.
5+
6+
### Added
7+
8+
- Add the ImportPackage Command. Refactored the APL Package section to consolidate common package definitions. Included the accept property for all package loading. Add an environment property packages to list packages loaded at document inflation.
9+
- Add List tags to support bulleted lists.
10+
- Add data as allowed image source type.
11+
- Add FlexSequence Component.
12+
- Add role to context elements.
13+
- Add the String.indexOf, String.lastIndexOf, and String.includes functions to String functions.
14+
15+
### Changed
16+
- Bug fixes.
17+
- Performance improvements.
18+
319
## [2024.2]
420

521
This release adds support for version 2024.2 of the APL specification.

Diff for: android/README.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Introduction
2+
This folder contains an Android gradle project that will build *APLCoreEngine* with the Android SDK/NDK and publish the static library binaries as a prefab with a coordinate of `com.amazon.apl.android:coreengine`.
3+
4+
# Publishing
5+
By default, the gradle project contains the `publishToMavenLocal` task which will publish `com.amazon.apl.android:coreengine` to a local maven repository. Additional publish targets must be added by the user.
6+
7+
# Unit Tests
8+
In order to run unit tests that include coverage of calls made to native libraries, this gradle project is capable of building *APLCoreEngine* using the default tool chain located on the host computer. Invoking the gradle task `buildHostBinary` will build `apl` and `alexaext` static libraries capable of being used in unit tests.
9+
10+
# Shortcuts
11+
Running the `localBuild` task will call both `publishToMavenLocal` and `buildHostBinary` automatically.

Diff for: android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
// Top-level build file where you can add configuration options common to all sub-projects/modules.
77

8-
def version = "2024.2.0";
8+
def version = "2024.3.0";
99

1010
buildscript {
1111
repositories {

Diff for: android/coreengine/build.gradle

+16-6
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ android {
3939
}
4040
}
4141

42+
sourceSets {
43+
main {
44+
// No java sources.
45+
java.srcDirs = []
46+
}
47+
}
4248
buildTypes {
4349
releaseWithSceneGraph {
4450
minifyEnabled false
@@ -108,6 +114,13 @@ publishing {
108114
task buildHostBinary(type: com.amazon.apl.android.CMakeTask) {
109115
cmakeArgs cmakeArg
110116
makeTargets "apl", "alexaext"
117+
doLast {
118+
copy {
119+
from fileTree(dir: '.cxx/cmake/debug/host/', include: '**/*.a').files
120+
include '**/*.a'
121+
into '../build'
122+
}
123+
}
111124
}
112125

113126
project.afterEvaluate {
@@ -122,10 +135,7 @@ project.afterEvaluate {
122135
}
123136

124137
task release(dependsOn: ['build', 'publish', 'buildHostBinary']) {
125-
doLast {
126-
copy {
127-
from '.cxx/cmake/debug/host/'
128-
into '../build'
129-
}
130-
}
131138
}
139+
140+
task localBuild(dependsOn: ['build', 'publishToMavenLocal', 'buildHostBinary']) {
141+
}

Diff for: apl-dev-env.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,8 @@ function apl-test-core { # Run unit tests in the core build
136136
-DBUILD_ALEXAEXTENSIONS=ON \
137137
-DENABLE_SCENEGRAPH=ON .. && \
138138
make -j$APL_BUILD_PROCS && \
139-
aplcore/unit/unittest && \
140-
tools/unit/tools-unittest && \
141-
extensions/unit/alexaext-unittest
139+
aplcore/unit/unittest $@ && \
140+
extensions/unit/alexaext-unittest $@
142141
)
143142
}
144143

@@ -148,7 +147,6 @@ function apl-memcheck-core { # Run unit tests in the core build
148147
$CMAKE -DBUILD_TESTS=ON -DCOVERAGE=OFF .. && \
149148
make -j$APL_BUILD_PROCS && \
150149
valgrind --tool=memcheck --gen-suppressions=all --track-origins=yes --leak-check=full --num-callers=50 ./aplcore/unit/unittest && \
151-
valgrind --tool=memcheck --gen-suppressions=all --track-origins=yes --leak-check=full --num-callers=50 ./tools/unit/tools-unittest && \
152150
valgrind --tool=memcheck --gen-suppressions=all --track-origins=yes --leak-check=full --num-callers=50 ./extensions/unit/alexaext-unittest
153151
)
154152
}

Diff for: aplcore/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ add_subdirectory(src/touch)
8888
add_subdirectory(src/utils)
8989
add_subdirectory(src/versioning)
9090
add_subdirectory(src/scenegraph)
91+
add_subdirectory(src/yoga)
9192

9293
set(
9394
PUBLIC_HEADER_LIST

Diff for: aplcore/include/apl/action/action.h

+7
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ namespace apl {
2828

2929
// Forward declarations
3030
class ActionRef;
31+
class ActionData;
3132

3233
using ActionList = std::vector<ActionPtr>;
3334

@@ -200,6 +201,12 @@ class Action : public std::enable_shared_from_this<Action>,
200201
*/
201202
virtual bool rehydrate(const CoreDocumentContext& context);
202203

204+
/**
205+
* Get details about this action
206+
* @return ActionData including details about target component and command (if any).
207+
*/
208+
virtual ActionData getActionData();
209+
203210
protected:
204211
virtual void onFinish() {}
205212

Diff for: aplcore/include/apl/action/animatedscrollaction.h

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class AnimatedScrollAction : public ResourceHoldingAction {
4141
void scroll(bool vertical, const Point& position);
4242

4343
CoreComponentPtr mContainer;
44+
ActionData getActionData() override;
4445

4546
private:
4647
void advance();

Diff for: aplcore/include/apl/action/animateitemaction.h

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class AnimateItemAction : public ResourceHoldingAction {
3939

4040
void freeze() override;
4141
bool rehydrate(const CoreDocumentContext& context) override;
42+
ActionData getActionData() override;
4243

4344
private:
4445
void start();

Diff for: aplcore/include/apl/action/autopageaction.h

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class AutoPageAction : public ResourceHoldingAction {
4242

4343
void freeze() override;
4444
bool rehydrate(const CoreDocumentContext& context) override;
45+
ActionData getActionData() override;
4546

4647
private:
4748
void advance();

Diff for: aplcore/include/apl/action/controlmediaaction.h

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ class ControlMediaAction : public ResourceHoldingAction {
3737
const std::shared_ptr<CoreCommand>& command,
3838
const ComponentPtr& target);
3939

40+
ActionData getActionData() override;
41+
4042
private:
4143
void start();
4244

Diff for: aplcore/include/apl/action/playmediaaction.h

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class PlayMediaAction : public ResourceHoldingAction {
4141

4242
void freeze() override;
4343
bool rehydrate(const CoreDocumentContext& context) override;
44+
ActionData getActionData() override;
4445

4546
private:
4647
void start();

Diff for: aplcore/include/apl/action/setpageaction.h

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class SetPageAction : public ResourceHoldingAction {
3838

3939
void freeze() override;
4040
bool rehydrate(const CoreDocumentContext& context) override;
41+
ActionData getActionData() override;
4142

4243
private:
4344
void start();

Diff for: aplcore/include/apl/action/speakitemaction.h

+1-9
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,7 @@ class SpeakItemAction : public ResourceHoldingAction {
5454

5555
void freeze() override;
5656
bool rehydrate(const CoreDocumentContext& context) override;
57-
58-
private:
59-
void start();
60-
void scroll(const std::shared_ptr<ScrollToAction>& action);
61-
void advance();
57+
ActionData getActionData() override;
6258

6359
private:
6460
friend class SpeakListAction;
@@ -69,10 +65,6 @@ class SpeakItemAction : public ResourceHoldingAction {
6965
std::string mSource; // The URL of the audio file to play
7066

7167
friend class SpeakItemActionPrivate;
72-
#ifdef SCENEGRAPH
73-
friend class SpeakItemActionPrivateSceneGraph;
74-
#endif // SCENEGRAPH
75-
friend class SpeakItemActionPrivateEvents;
7668
std::unique_ptr<SpeakItemActionPrivate> mPrivate;
7769
};
7870

Diff for: aplcore/include/apl/apl.h

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
#include "apl/primitives/urlrequest.h"
7676
#include "apl/scaling/metricstransform.h"
7777
#include "apl/touch/pointerevent.h"
78+
#include "apl/utils/dataurl.h"
7879
#include "apl/utils/localemethods.h"
7980
#include "apl/utils/log.h"
8081
#include "apl/utils/session.h"

Diff for: aplcore/include/apl/command/corecommand.h

+3
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ class CoreCommand : public Command {
119119
const bool mScreenLock;
120120
std::string mSequencer;
121121

122+
private:
123+
void logProperties();
124+
122125
private:
123126
std::string mBaseId;
124127
std::string mTargetId;

Diff for: aplcore/include/apl/common.h

+2
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class CoreDocumentContext;
7171
class CoreRootContext;
7272
class DataSource;
7373
class DataSourceProvider;
74+
class DataUrl;
7475
class Dependant;
7576
class DependantManager;
7677
class DocumentConfig;
@@ -128,6 +129,7 @@ using ConstCoreComponentPtr = std::shared_ptr<const CoreComponent>;
128129
using CoreDocumentContextPtr = std::shared_ptr<CoreDocumentContext>;
129130
using CoreRootContextPtr = std::shared_ptr<CoreRootContext>;
130131
using DataSourceProviderPtr = std::shared_ptr<DataSourceProvider>;
132+
using DataUrlPtr = std::shared_ptr<DataUrl>;
131133
using DependantPtr = std::shared_ptr<Dependant>;
132134
using DocumentConfigPtr = std::shared_ptr<DocumentConfig>;
133135
using DocumentContextDataPtr = std::shared_ptr<DocumentContextData>;

Diff for: aplcore/include/apl/component/component.h

+7-6
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ class Component : public UIDObject,
222222
* @param key The PropertyKey of the prop to return.
223223
* @return The current value assigned to that property.
224224
*/
225-
const Object& getCalculated( PropertyKey key ) const { return mCalculated.get(key); }
225+
const Object& getCalculated( PropertyKey key ) const;
226226

227227
/**
228228
* @return The primitive type of the component.
@@ -251,15 +251,14 @@ class Component : public UIDObject,
251251
ConstContextPtr getContext() const { return mContext; }
252252

253253
/**
254-
* @return True if this component was properly created with all required
255-
* properties specified.
254+
* @return True if this component was properly created and can be used from an external API standpoint.
256255
*/
257-
bool isValid() { return !mFlags.isSet(kComponentFlagInvalid); }
256+
bool isValid() const { return !mFlags.isSet(kComponentFlagInvalid) && !mFlags.isSet(kComponentFlagIsReleased); }
258257

259258
/**
260259
* @return True if this component has been inflated and should now run event handlers on a SetValue or equivalent.
261260
*/
262-
bool allowEventHandlers() { return mFlags.isSet(kComponentFlagAllowEventHandlers);}
261+
bool allowEventHandlers() const { return mFlags.isSet(kComponentFlagAllowEventHandlers);}
263262

264263
/**
265264
* An update message from the viewhost. This method is used for all updates that take
@@ -280,8 +279,9 @@ class Component : public UIDObject,
280279
/**
281280
* Update component media state. Not applicable for every component.
282281
* @param state component's MediaState.
282+
* @deprecated Use MediaPlayer interface.
283283
*/
284-
virtual void updateMediaState(const MediaState& state, bool fromEvent = false);
284+
virtual void updateMediaState(const MediaState& state, bool fromEvent = false) { aplThrow(NOT_SUPPORTED_ERROR); }
285285

286286
/**
287287
* Update graphics display. Not applicable for every component.
@@ -524,6 +524,7 @@ class Component : public UIDObject,
524524
enum ComponentFlags : uint8_t {
525525
kComponentFlagInvalid = 1u << 0, // Marks a component missing a required property
526526
kComponentFlagAllowEventHandlers = 1u << 1, // Event handlers don't run when the component is first inflated
527+
kComponentFlagIsReleased = 1u << 2, // Component was released and no longer valid
527528
};
528529

529530
Flags<ComponentFlags> mFlags;

Diff for: aplcore/include/apl/component/componentpropdef.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@
1818

1919
#include "apl/component/component.h"
2020
#include "apl/engine/propdef.h"
21-
22-
#include <yoga/YGNode.h>
21+
#include "apl/yoga/yoganode.h"
2322

2423
namespace apl {
2524

2625
using Trigger = void (*)(Component&);
27-
using LayoutFunc = void (*)(YGNodeRef nodeRef, const Object& object, const Context& context);
26+
using LayoutFunc = void (*)(YogaNode& node, const Object& object, const Context& context);
2827
using DefaultFunc = Object (*)(Component&, const RootConfig&);
2928
using GetterFunc = Object (*)(const CoreComponent&);
3029
using SetterFunc = void (*)(CoreComponent&, const Object&);

Diff for: aplcore/include/apl/component/componentproperties.h

+15-1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,16 @@ enum FlexboxAlign {
9292
kFlexboxAlignAuto = 5
9393
};
9494

95+
/**
96+
* Used by alignItems in a FlexSequenceComponent
97+
* Don't change these values without checking component.cpp
98+
*/
99+
enum FlexboxAlignAxis {
100+
kFlexboxAlignAxisStart = 0,
101+
kFlexboxAlignAxisEnd = 1,
102+
kFlexboxAlignAxisCenter = 2
103+
};
104+
95105
/**
96106
* Layout direction of a ContainerComponent
97107
*/
@@ -746,6 +756,8 @@ enum PropertyKey {
746756
kPropertyOnCursorEnter,
747757
/// Component handler for cursor exit
748758
kPropertyOnCursorExit,
759+
/// Component handler for cursor move
760+
kPropertyOnCursorMove,
749761
/// Component attached to Yoga tree and has flexbox properties calculated.
750762
kPropertyLaidOut,
751763
/// EditTextComponent restrict the characters that can be entered
@@ -771,7 +783,8 @@ enum ComponentType {
771783
kComponentTypeText,
772784
kComponentTypeTouchWrapper,
773785
kComponentTypeVectorGraphic,
774-
kComponentTypeVideo
786+
kComponentTypeVideo,
787+
kComponentTypeFlexSequenceComponent
775788
};
776789

777790
extern Bimap<int, std::string> sAlignMap;
@@ -783,6 +796,7 @@ extern Bimap<int, std::string> sTextAlignVerticalMap;
783796
extern Bimap<int, std::string> sKeyboardTypeMap;
784797
extern Bimap<int, std::string> sSubmitKeyTypeMap;
785798
extern Bimap<int, std::string> sFlexboxAlignMap;
799+
extern Bimap<int, std::string> sFlexboxAlignAxisMap;
786800
extern Bimap<int, std::string> sContainerDirectionMap;
787801
extern Bimap<int, std::string> sFlexboxJustifyContentMap;
788802
extern Bimap<int, std::string> sFlexboxWrapMap;

0 commit comments

Comments
 (0)