Skip to content

Instantly share code, notes, and snippets.

@tm9k1
Created May 30, 2021 08:50
Show Gist options
  • Save tm9k1/2312937dbdda73b366d02829078540af to your computer and use it in GitHub Desktop.
Save tm9k1/2312937dbdda73b366d02829078540af to your computer and use it in GitHub Desktop.
Workspace file for KDE Connect for Windows port development using Craft
{
"folders": [
{
"name": "kdeconnect-kde",
"path": "C:/CraftRoot/download/git/kde/applications/kdeconnect-kde",
}
],
"launch": {
"version": "0.2.0",
"configurations": [
{
"name": "KDE C Daemon",
"type": "cppvsdbg",
"request": "launch",
"program": "C:/CraftRoot/bin/kdeconnectd.exe",
"args": [],
"cwd": "${fileWorkspaceFolder}",
"stopAtEntry": false,
"preLaunchTask": "Build",
"console": "internalConsole",
"internalConsoleOptions": "openOnSessionStart",
"sourceFileMap": {
"C:/CraftRoot/build/_/af542817/kdeconnect-kde": "C:/CraftRoot/download/git/kde/applications/kdeconnect-kde",
"C:/_/93d21b40/qtbase-everywhere-src-5.15.2": "C:/CraftRoot/build/libs/qt5/qtbase/work/qtbase-everywhere-src-5.15.2",
}
},
{
"name": "KDE C Indicator",
"type": "cppvsdbg",
"request": "launch",
"program": "C:/CraftRoot/bin/kdeconnect-indicator.exe",
"args": [],
"cwd": "${fileWorkspaceFolder}",
"stopAtEntry": false,
"preLaunchTask": "Build",
"console": "internalConsole",
"internalConsoleOptions": "openOnSessionStart",
"sourceFileMap": {
"C:/CraftRoot/build/_/af542817/kdeconnect-kde": "C:/CraftRoot/download/git/kde/applications/kdeconnect-kde",
"C:/_/93d21b40/qtbase-everywhere-src-5.15.2": "C:/CraftRoot/build/libs/qt5/qtbase/work/qtbase-everywhere-src-5.15.2",
}
}
],
"compounds": []
},
"tasks": {
"version": "2.0.0",
"tasks": [
{
"label": "Build",
"type": "shell",
"command": "python3",
"args": [
"C:/CraftRoot/craft/bin/craft.py",
"--compile",
"--install",
"--qmerge",
"\"$(Split-Path -Path ${fileWorkspaceFolder} -LeafBase)\""
],
"runOptions": {
"reevaluateOnRerun": true,
},
"dependsOn": "Cleanup",
},
{
"label": "Cleanup",
"type": "shell",
"command": "TASKKILL",
"args": [
"/F",
"/FI",
"imagename eq kdeconnect*",
"/IM",
"*",
],
"runOptions": {
"reevaluateOnRerun": true,
},
}
],
},
"settings": {
"[cpp]": {
"editor.wordBasedSuggestions": false,
"editor.suggest.insertMode": "replace",
"editor.semanticHighlighting.enabled": true,
"editor.quickSuggestions": true,
},
"C_Cpp.default.includePath": [
"C:/CraftRoot/include/**",
"C:/CraftRoot/build/**",
"${workspaceFolder}/**",
],
"C_Cpp.default.defines": [
"QSYSTRAY",
"Q_OS_WIN"
],
"files.associations": {
"qdebug": "cpp",
"qstandardpaths": "cpp",
"qicon": "cpp",
"qfile": "cpp"
},
}
}
@tm9k1
Copy link
Author

tm9k1 commented May 30, 2021

This workspace file also supports building any additional KDE projects you might have changed during development. Just keep a file of that project as the currently opened and active file, and hit Debug! (or run the Build task from the workspace)

Prerequisites

  • Run this command in Craft
    craft --fetch --unpack libs/qt5/qtbase
    
  • Make sure you get a working Python interpreter when you run python3.exe from the command line in VSCode.

    If not, install Python from Windows Store, it works.

If you install Craft to a non-default location

  • Replace C:/CraftRoot to your `x:/path/to/CraftRoot'.
  • Replace C:/CraftRoot/build/_/af542817/kdeconnect-kde with whatever current-working-directory you get after doing cs kdeconnect-kde.
  • Replace C:/_/93d21b40/qtbase-everywhere-src-5.15.2 with whatever current-working-directory you get after doing cs libs/qt5/qtbase, but remove /CraftRoot/build from that path!

More info about workspace files at : https://code.visualstudio.com/docs/editor/workspaces

@LeLocTai
Copy link

Should I clone to C:/CraftRoot/download/git/kde/applications/kdeconnect-kde manually? I see there this line in CraftSettings.ini, but can't find any command to make craft do the cloning

#KDEGitDir = ${DOWNLOADDIR}\git

Also, what does the path from cs kdeconnect-kde do? Why do we need another copy of the source code?

@tm9k1
Copy link
Author

tm9k1 commented Jun 10, 2021 via email

@LeLocTai
Copy link

I followed https://community.kde.org/KDEConnect/Build_Windows and successfully built the code.

However I don't have the CraftRoot/download/git dir like in your config, only the $(cs kdeconnect-kde) path, containing the source code without git information. I'm wondering if I'm expected to clone manually, or is there a way for craft to do it.

@tm9k1
Copy link
Author

tm9k1 commented Jun 11, 2021

that's not expected.. could you re-run the long list of commands in https://community.kde.org/KDEConnect/Build_Windows#1._BUILDING_KDE_CONNECT_OUT_OF_LATEST_SOURCE_CODE and see if it works for you? Setting up kdeconnect-kde for the first time must have taken around an hour or so. If not, you probably didn't build it from source.

Also, share your CraftRoot/etc/BlueprintsSettings.ini file after you run the above mentioned commands.

@LeLocTai
Copy link

You're right, I did not complete building everything, must have misread something. I have to set kirigmi version to master for it to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment