Skip to content

Commit

Permalink
DRILL_VERSION inside executable and fix AppImage
Browse files Browse the repository at this point in the history
  • Loading branch information
yatima1460 committed Jun 14, 2019
1 parent e55f8a6 commit 553d3bf
Show file tree
Hide file tree
Showing 20 changed files with 122 additions and 127 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ Build
drill-ui
drill-cli

# Drill
DRILL_VERSION

# D
dub.selections.json
.dub
Expand Down
21 changes: 8 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@ branches:
only:
- master


os:
- linux
- windows
- osx


language: bash


before_install:
- export TRAVIS_TAG="1.$TRAVIS_BUILD_NUMBER"
- echo -n $TRAVIS_TAG > DRILL_VERSION


addons:

#linux
Expand All @@ -31,11 +35,6 @@ addons:
- dub
- p7zip

# choco:
# update: true
# packages:
# - dmd
# - dub

script:

Expand All @@ -48,12 +47,8 @@ script:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt install ./dmd_2.086.0-0_amd64.deb; fi

## windows
# - if [ "$TRAVIS_OS_NAME" = "windows" ]; then choco install dmd; fi
# - if [ "$TRAVIS_OS_NAME" = "windows" ]; then choco install dub; fi
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then wget http://downloads.dlang.org/nightlies/dmd-master/dmd.master.windows.7z; fi
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then 7z x dmd.master.windows.7z; fi
# - if [ "$TRAVIS_OS_NAME" = "windows" ]; then cp dmd2/windows/bin/*.* Source/Frontend/CLI; fi
# - if [ "$TRAVIS_OS_NAME" = "windows" ]; then cp dmd2/windows/bin/*.* Source/Frontend/WinAPI; fi

## osx
# already installs using homebrew travis settings
Expand All @@ -69,22 +64,22 @@ script:

## build UI

### linux
### Linux
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then cd Source/Frontend/GTK; fi
# - if [ "$TRAVIS_OS_NAME" = "linux" ]; then dub build --arch=x86; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then dub build --arch=x86_64; fi
# - if [ "$TRAVIS_OS_NAME" = "linux" ]; then dub build -b release --arch=x86; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then dub build -b release --arch=x86_64; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then cd ../../../; fi

### windows
### Windows
# - if [ "$TRAVIS_OS_NAME" = "windows" ]; then cd Source/Frontend/WinAPI; fi
# - if [ "$TRAVIS_OS_NAME" = "windows" ]; then $DUB build --arch=x86; fi
# - if [ "$TRAVIS_OS_NAME" = "windows" ]; then $DUB build --arch=x86_64; fi
# - if [ "$TRAVIS_OS_NAME" = "windows" ]; then $DUB build -b release --arch=x86; fi
# - if [ "$TRAVIS_OS_NAME" = "windows" ]; then $DUB build -b release --arch=x86_64; fi
# - if [ "$TRAVIS_OS_NAME" = "windows" ]; then cd ../../../; fi

### OSX


# build installers/packages

Expand Down
2 changes: 1 addition & 1 deletion Assets/PriorityLists/cloud.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Google Drive$
Google Drive
14 changes: 7 additions & 7 deletions Assets/PriorityLists/english.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Desktop$
Downloads$
Pictures$
Documents$
Videos$
Music$
Users$
Desktop
Downloads
Pictures
Documents
Videos
Music
Users
14 changes: 7 additions & 7 deletions Assets/PriorityLists/italian.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Desktop$
Download$
Immagini$
Documenti$
Video$
Musica$
Utenti$
Desktop
Download
Immagini
Documenti
Video
Musica
Utenti
2 changes: 1 addition & 1 deletion Assets/PriorityLists/linux.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
home$
home
32 changes: 16 additions & 16 deletions Assets/PriorityLists/video.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
1080p$
720p$
2160p$
480p$
h264$
h265$
hevc$
x265$
x264$
360p$
240p$
multi$
Season$
season$
Multi$
ddp5\.1$
1080p
720p
2160p
480p
h264
h265
hevc
x265
x264
360p
240p
multi
Season
season
Multi
ddp5\.1
1 change: 1 addition & 0 deletions DRILL_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.0.0
2 changes: 1 addition & 1 deletion Source/Backend/API.d
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private:
immutable(string[]) BLOCK_LIST;

const(Regex!char[]) PRIORITY_LIST_REGEX;
static string DRILL_VERSION = "0.0.0";
static string DRILL_VERSION = import("DRILL_VERSION");

public:

Expand Down
2 changes: 1 addition & 1 deletion Source/Backend/Crawler.d
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ private:

if (currentFile.isDir())
{
if (isPrioritylisted(currentFile.name))
if (isPrioritylisted(baseName(currentFile.name)))
{
Logger.logDebug("Priority listed: "~currentFile.name);
queue.insertFront(currentFile);
Expand Down
2 changes: 2 additions & 0 deletions Source/Backend/dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"dependencies": {
"datefmt": "1.0.3"
},

"dflags":["-J=\"../../../\""],

"targetPath": "Build/Drill-Core-$PLATFORM-$ARCH-$BUILD_TYPE"
}
4 changes: 2 additions & 2 deletions Source/Frontend/GTK/Window.d
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ private:
assert(icon_name != null);
liststore.setValue(it, Column.NAME_ICON, icon_name);

debug{logConsole("[DRILL][GTK] "~fi.extension~" setting icon to " ~ this.iconmap[ext]);}
Logger.logTrace(fi.extension~" setting icon to " ~ this.iconmap[ext]);
}
}

Expand All @@ -244,7 +244,7 @@ private:
liststore.setValue(it, Column.DATE_MODIFIED, fi.dateModifiedString);
debug{liststore.setValue(it, Column.FOUND_BY_CRAWLER, fi.originalMountpoint);}

debug{logConsole("[DRILL][GTK] Added to the list: "~fi.fullPath);}
Logger.logTrace("[DRILL][GTK] Added to the list: "~fi.fullPath);
// this.setSizeRequest(requisition.width,requisition.height);
}

Expand Down
31 changes: 7 additions & 24 deletions Tools/AppImage/Drill_GTK.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
app: Drill
ingredients:
# dist: trusty
# sources:
# - deb http://deb.debian.org/debian stretch main
# packages:
# - libgcc1
# - libgtk3.0


# create the necessary dirs
script:
- mkdir -p me.santamorena.drill.AppDir/usr

# copy the assets
script:
- cd ../../../
- cp Drill-GTK tools/appimage/me.santamorena.drill/me.santamorena.drill.AppDir/usr/Drill
- cp DRILL_VERSION tools/appimage/me.santamorena.drill/me.santamorena.drill.AppDir/usr/
- chmod +x tools/appimage/me.santamorena.drill/me.santamorena.drill.AppDir/usr/Drill
- cp -r assets tools/appimage/me.santamorena.drill/me.santamorena.drill.AppDir/usr/
- cd tools/appimage
- cp drill.sh me.santamorena.drill/me.santamorena.drill.AppDir/usr/
- chmod +x me.santamorena.drill/me.santamorena.drill.AppDir/usr/drill.sh
- cp me.santamorena.drill.desktop me.santamorena.drill/me.santamorena.drill.AppDir
- cp ../../assets/icon.svg me.santamorena.drill/me.santamorena.drill.AppDir
script:
- cp -r ../../../../Source/Frontend/GTK/Build/Drill-GTK-linux-x86_64-release/* usr
- mv usr/drill-search-gtk usr/drill-search-gtk.elf
- chmod +x usr/drill-search-gtk.elf
- cp ../../drill-search-gtk.desktop .
- cp ../../drill-search-gtk.svg .
- cp ../../drill-search-gtk.bash usr
7 changes: 2 additions & 5 deletions Tools/AppImage/build_appimage_gtk.bash
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/bin/bash


if [ -z "$TRAVIS_TAG" ]; then
echo This is not a Travis build! Using LOCAL_BUILD as version string
export TRAVIS_TAG="LOCAL_BUILD"
fi
export DRILL_VERSION=$(cat ../../DRILL_VERSION)

#cp ../deb/Build/Drill-GTK-linux-x86_64-release-$TRAVIS_TAG.deb .

Expand All @@ -15,5 +12,5 @@ bash -ex ./pkg2appimage Drill_GTK.yml
#rm Drill-GTK-linux-x86_64-release-$TRAVIS_TAG.deb

mkdir -p Build
mv out/*.AppImage Build/Drill-GTK-linux-x86_64-release-$TRAVIS_TAG.AppImage
mv out/*.AppImage Build/Drill-GTK-linux-x86_64-release-"$DRILL_VERSION".AppImage
rmdir out
2 changes: 2 additions & 0 deletions Tools/AppImage/drill-search-gtk.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
./drill-search-gtk.elf
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[Desktop Entry]
Version=1.0
Name=Drill
Type=Application
Comment=Search files without using indexing, but clever crawling
Comment[it]=Trova files sul tuo PC senza indicizzare, ma cercando intelligentemente
Icon=icon.svg
Exec=drill-search-gtk
Terminal=false
Categories=Application;Utility;GTK;
[Desktop Entry]
Version=1.0
Name=Drill
Type=Application
Comment=Search files without using indexing, but clever crawling
Comment[it]=Trova files sul tuo PC senza indicizzare, ma cercando intelligentemente
Icon=drill-search-gtk.svg
Exec=bash drill-search-gtk.bash
TryExec=bash drill-search-gtk.bash
Terminal=false
Categories=Application;Utility;GTK;
Keywords=Search;FileSearch;File Search;Find;
38 changes: 38 additions & 0 deletions Tools/AppImage/drill-search-gtk.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 3 additions & 6 deletions Tools/PortableZip/create_zip.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@



if [ -z "$TRAVIS_TAG" ]; then
echo This is not a Travis build! Using LOCAL_BUILD as version string
export TRAVIS_TAG="LOCAL_BUILD"
fi
DRILL_VERSION=$(cat ../../DRILL_VERSION)

mkdir Build
FILES="../../Source/Frontend/GTK/Build/*
Expand All @@ -22,8 +19,8 @@ do

if [[ -d "$f" ]]; then
echo "$f exists"
7z a -tzip "$f"-"$TRAVIS_TAG".zip "$f"/* ../../DRILL_VERSION
mv "$f"-$TRAVIS_TAG.zip Build
7z a -tzip "$f"-"$DRILL_VERSION".zip "$f"/*
mv "$f"-$DRILL_VERSION.zip Build
else
echo "$f does not exist, skipping"
fi
Expand Down
Loading

0 comments on commit 553d3bf

Please sign in to comment.