Skip to content

Commit

Permalink
Use less confusing naming in Qt/rust library build structure
Browse files Browse the repository at this point in the history
- Rename Qt lib project from rust to gitcomponents
- Module is now GitbumrComponents
- Rust static lib is still "rust"
  • Loading branch information
stofte committed Mar 21, 2019
1 parent ffb0573 commit 41713d1
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion app/qml/components/BranchView.qml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import QtQuick 2.9
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3
import RustCode 1.0
import GitbumrComponents 1.0
import "../base"
import "../style"

Expand Down
2 changes: 1 addition & 1 deletion app/qml/components/DiffsView.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import QtQuick 2.9
import RustCode 1.0
import GitbumrComponents 1.0
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import "../base"
Expand Down
2 changes: 1 addition & 1 deletion app/qml/components/GitView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Controls 1.4 as QQC14
import QtQuick.Layouts 1.3
import RustCode 1.0
import GitbumrComponents 1.0
import "../style"
import "../base"

Expand Down
2 changes: 1 addition & 1 deletion app/qml/components/RepoView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import QtQuick.Dialogs 1.3
import RustCode 1.0
import GitbumrComponents 1.0
import "../base"
import "../style"

Expand Down
2 changes: 1 addition & 1 deletion app/qml/main.qml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import QtQuick 2.9
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import RustCode 1.0
import GitbumrComponents 1.0
import "components"
import "base"
import "style"
Expand Down
4 changes: 2 additions & 2 deletions lib/rustcode_plugin.cpp → lib/gitbumrcomponents_plugin.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "rustcode_plugin.h"
#include "gitbumrcomponents_plugin.h"
#include <qqml.h>

void RustCodePlugin::registerTypes(const char *uri)
void GitbumrComponentsPlugin::registerTypes(const char *uri)
{
qmlRegisterType<Repositories>(uri, 1, 0, "Repositories");
qmlRegisterType<Git>(uri, 1, 0, "Git");
Expand Down
2 changes: 1 addition & 1 deletion lib/rustcode_plugin.h → lib/gitbumrcomponents_plugin.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <QQmlExtensionPlugin>
#include "Bindings.h"

class RustCodePlugin : public QQmlExtensionPlugin
class GitbumrComponentsPlugin : public QQmlExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
Expand Down
18 changes: 6 additions & 12 deletions lib/lib.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#-------------------------------------------------

QT += qml quick quickcontrols2
TARGET = rust
TARGET = gitcomponents
TEMPLATE = lib
CONFIG += c++14 plugin

Expand All @@ -22,11 +22,11 @@ DEFINES += QT_DEPRECATED_WARNINGS

SOURCES += \
Bindings.cpp \
rustcode_plugin.cpp
gitbumrcomponents_plugin.cpp

HEADERS += \
Bindings.h \
rustcode_plugin.h
gitbumrcomponents_plugin.h

DISTFILES = qmldir

Expand All @@ -51,11 +51,10 @@ CONFIG(release, release|debug) {
win32:CCRS_CFLAGS = cd & set CFLAGS=/MD
}

DESTDIR = $$BUILD_MODE/RustCode
DESTDIR = $$BUILD_MODE/GitbumrComponents
# Note that this is the rust "blob" itself,
# so it's not in placed in the DESTDIR folder.
LIBS += -L"$$PWD/target/$$RUST_TARGET/$$BUILD_MODE" -lrust
#message("LIBS => $$PWD/target/$$RUST_TARGET/$$BUILD_MODE")
win32 {
LIBS += WS2_32.lib Userenv.lib Advapi32.lib Shell32.lib \
winhttp.lib Rpcrt4.lib OLE32.LIB Userenv.lib user32.lib
Expand All @@ -65,8 +64,8 @@ linux {
}

# if you are using Shadow build, you need to get the output folder
CONFIG(release, debug|release): DESTDIR = $$OUT_PWD/release/RustCode
CONFIG(debug, debug|release): DESTDIR = $$OUT_PWD/debug/RustCode
CONFIG(release, debug|release): DESTDIR = $$OUT_PWD/release/GitbumrComponents
CONFIG(debug, debug|release): DESTDIR = $$OUT_PWD/debug/GitbumrComponents

#CONFIG(release, debug|release): DESTDIR = release
#CONFIG(debug, debug|release): DESTDIR = debug
Expand All @@ -85,8 +84,6 @@ RUST_FILES = \
src/implementation/hunks.rs \
src/implementation/diffs.rs

#copyshit.commands = "copy $$PWD/qmldir $$DESTDIR/qmldir"

rust_cargo.output = "$$PWD/target/$$RUST_TARGET/$$BUILD_MODE/rust.lib"
linux:rust_cargo.output = "$$PWD/target/$$RUST_TARGET/$$BUILD_MODE/librust.a"
rust_cargo.commands = $$CCRS_CFLAGS & \
Expand All @@ -98,9 +95,6 @@ rust_cargo.input = RUST_FILES
# allow a clean build.
# rust_cargo.clean = this_file_is_not_here & cargo clean --manifest-path="$$PWD/lib/Cargo.toml"
QMAKE_EXTRA_COMPILERS += rust_cargo
#QMAKE_POST_LINK = copy qmldir $$DESTDIR/qmldir
# DISTFILES is only used when dist target is run via make. Just do a basic copy instead.
#system($$system_quote(copy $$PWD/qmldir $$DESTDIR/qmldir))

COPY_CMD=copy
linux:COPY_CMD=cp
Expand Down
6 changes: 3 additions & 3 deletions lib/qmldir
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module RustCode
plugin rust
classname RustCodePlugin
module GitbumrComponents
plugin gitcomponents
classname GitbumrComponentsPlugin
18 changes: 12 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# Gitbumr [![Build status](https://ci.appveyor.com/api/projects/status/211dlbqs63w61har?svg=true)](https://ci.appveyor.com/project/stofte/gitbumr)

Qt based Git client using a rust backend. This is a hobby-project, wip, eg do not commit important things with this client.
Qt based Git client using a rust backend. WIP.

![Log view](https://i.imgur.com/NLjuY5R.png "Log view")

# Development

Following are requirements to build the repository locally.

- [rustc 1.33.0](https://rustup.rs/)
- [Qt 5.12.1](https://www.qt.io/offline-installers)
- [rust-qt-binding-generator](https://github.com/KDE/rust-qt-binding-generator)
- [rust-qt-binding-generator](https://github.com/KDE/rust-qt-binding-generator)

The project has a QtCreator project, which doubles as a project file and a
makefile for [qmake](http://doc.qt.io/qt-5/qmake-manual.html).
makefile for [qmake](http://doc.qt.io/qt-5/qmake-manual.html). Generated bindings
are checked into sourcecontrol so the rust-qt binding generator is not required
for just building.

## Rust+Qt bindings

Expand Down Expand Up @@ -45,9 +49,11 @@ Tested on Ubuntu 18.04.2 LTS from Windows, using PuTTY/[VcXsrv](https://sourcefo
- Install `./qt-opensource-linux-x64-5.12.1.run`
- Ensure *Tools > QtCreator* and *Qt > Desktop gcc 64-bit* are selected

Be sure to run VcXsrv in the [right configuration](https://github.com/Microsoft/WSL/issues/2855#issuecomment-358861903) and remember to set/export `LIBGL_ALWAYS_INDIRECT=1` in the shell. If using PuTTY, also remember to check "Enable X11 forwarding" under *Connection > SSH > X11*,
and instead of setting the `DISPLAY` env variable in the shell (which did not work for me),
enter `:0` for "X display location".
Be sure to run VcXsrv in the [right configuration](https://github.com/Microsoft/WSL/issues/2855#issuecomment-358861903)
and remember to set/export `LIBGL_ALWAYS_INDIRECT=1` in the shell. If using PuTTY,
also remember to check "Enable X11 forwarding" under *Connection > SSH > X11*,
and instead of setting the `DISPLAY` env variable in the shell, enter `:0` in
the "X display location" field.

## Automated Tests

Expand Down
2 changes: 1 addition & 1 deletion test/tst_GitTests.qml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import QtQuick 2.9
import QtQuick.Window 2.2
import QtTest 1.0
import RustCode 1.0
import GitbumrComponents 1.0

TestCase {
name: "GitTests"
Expand Down

0 comments on commit 41713d1

Please sign in to comment.