Skip to content

Commit

Permalink
Remove make builtin logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jardon committed Feb 23, 2024
1 parent 23c075a commit 51ed210
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 36 deletions.
17 changes: 5 additions & 12 deletions snapcraft/extensions/qt_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,24 +215,17 @@ def get_part_snippet(self, *, plugin_name: str) -> Dict[str, Any]:

@overrides
def get_parts_snippet(self) -> Dict[str, Any]:
source = get_extensions_data_dir() / "desktop" / "command-chain"
sdk_snap = self.qt_snaps.sdk["snap"]
sdk_channel = self.qt_snaps.sdk["channel"]

if self.qt_snaps.builtin:
return {
f"{self.name}/sdk": {
"source": str(source),
"plugin": "make",
"make-parameters": ["PLATFORM_PLUG=qt-framework"],
"build-snaps": [f"{sdk_snap}/{sdk_channel}"],
},
}
return None

return {
f"{self.name}/sdk": {
"source": str(source),
"plugin": "make",
"make-parameters": ["PLATFORM_PLUG=qt-framework"],
"plugin": "nil",
"build-snaps": [
f"{sdk_snap}/{sdk_channel}",
],
},
}
30 changes: 6 additions & 24 deletions tests/unit/extensions/test_qt_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,41 +249,23 @@ def test_get_part_snippet(qt_framework_extension):
}


@pytest.mark.parametrize(fixture_variables, builtin_stable_values)
@pytest.mark.parametrize(fixture_variables, base_values)
def test_get_parts_snippet(qt_framework_extension, name):
source = get_extensions_data_dir() / "desktop" / "command-chain"
sdk_snap = qt_framework_extension.qt_snaps.sdk["snap"]
sdk_channel = qt_framework_extension.qt_snaps.sdk["channel"]

assert qt_framework_extension.get_parts_snippet() == {
f"{name}/sdk": {
"source": str(source),
"plugin": "make",
"make-parameters": ["PLATFORM_PLUG=qt-framework"],
}
f"{name}/sdk": {"plugin": "nil", "stage-snaps": [f"{sdk_snap}/{sdk_channel}"]}
}


@pytest.mark.parametrize(fixture_variables, builtin_stable_values)
def test_get_parts_snippet_with_external_sdk(qt_framework_extension, name):
source = get_extensions_data_dir() / "desktop" / "command-chain"

assert qt_framework_extension.get_parts_snippet() == {
f"{name}/sdk": {
"source": str(source),
"plugin": "make",
"make-parameters": ["PLATFORM_PLUG=qt-framework"],
}
}
assert qt_framework_extension.get_parts_snippet() == None


@pytest.mark.parametrize(fixture_variables, builtin_edge_values)
def test_get_parts_snippet_with_external_sdk_different_channel(
qt_framework_extension, name
):
source = get_extensions_data_dir() / "desktop" / "command-chain"
assert qt_framework_extension.get_parts_snippet() == {
f"{name}/sdk": {
"source": str(source),
"plugin": "make",
"make-parameters": ["PLATFORM_PLUG=qt-framework"],
}
}
assert qt_framework_extension.get_parts_snippet() == None

0 comments on commit 51ed210

Please sign in to comment.