Git Product home page Git Product logo

delphi-wakatime's Introduction

WakaTime Plugin for Delphi

A plugin implementation for integrating WakaTime to track your time activity programming with Delphi IDE's.

Any help is appreciated! Comments, suggestions, issues, PR's! Give us a star to help!

Goals

The goal of this project is to provide a full integration with WakaTime with Delphi IDE's as other implementations for currently supported IDE's like Visual Studio Code, JetBrains Rider, Android Studio, etc.

Currently supported and Tested IDE's

  • Delphi 12.0
  • Delphi 11.3
  • Delphi 10.0
  • Delphi 10.2
  • Delphi XE2
  • Delphi 7

It should work with any other IDE version up from D7 but it should be tested. If you have any other version and want to collaborate just go to the section Adding to new IDE.

Support this plugin's author (@diegomgarcia) with Patreon

Patreon

Or make a single donation buying me a coffee:

Buy Me A Coffee

You can also show support by showing on your repository that you use this lib on it with a direct link to it.

How should I use it?

1- Clone this repository.

2- Open the project related to your IDE version:

  • WakaTimePlugin12_0.dproj - For Delphi 12.0
  • WakaTimePlugin11_3.dproj - For Delphi 11.3
  • WakaTimePlugin10.dproj - For Delphi 10.0
  • WakaTimePlugin10_2.dproj - For Delphi 10.2
  • WakaTimePluginXE2.dproj - For Delphi XE2
  • WakaTimePluginD7.dpr - For Delphi 7

Note: If your IDE is not listed here, don't be afraid, just go to the section Adding to new IDE and get back here after to continue.

3- Build and Install

4- Close the project

5- Go to the Tools menu and access the new WakaTime Settings menu.

6- Insert your WakaTime API key and hit OK.

Tip To get your WakaTime API Key, go to your WakaTime account, click on your avatar on settings and you will see a section named API Key with the text Secret API Key and a button to copy, just click on copy button and paste it on the settings of the plugin. You can also find it by going to this link.

If you use GetIt Package Manager, this package can be installed from there.

Adding to new IDE

If your IDE does not have a package created for it yet, no worries just do the following steps:

Before start close all projects opened on your Delphi IDE.

1- On your Delphi IDE go to the File -> New -> Package.

2- With the new Package created save the project inside the plugin directory with the name WakaTimePlugin{YourDelphiVersion}.

3- Right click on the project file and select the option Add... after that select all .pas files inside the plugin folder and hit the Open button. This will add all the files to this new package.

4- Right click on the Requires section of the package and click on the option Add Reference, click on the Browse button, and go to the directory "C:\Program Files (x86)\Embarcadero\Studio\{YourDelphiVersion}\lib\win32\release" and select the file designide.dcp then click on ok and ok again to add it to the package.

5- Now just save again and build your new plugin project, the IDE might ask to add a reference to RTL, just click on ok and continue the build.

6- Install the package on IDE and get back to step 3 of the section How should I use?

Note: Don't forget, after you test the plugin with your new IDE you can make a PR here so we can update the supported IDE list.

Know Issues

1- Before removing the package close all files on the editor, or you will get an invalid pointer operation. For some reason removing the reference on package removal with the files opened on the editor is trying to remove the reference more than one time, causing this error. I'm investigating the root cause.

2- On Delphi 7 sometimes after compiling and clicking on install the IDE hangs and closes, just open the IDE again and add the BPL using the menu -> component -> install packages -> add -> select the BPL's compiled inside the path: C:\Program Files\Borland\Projects\Bpl\WakatimeD7.bpl

3- If for some reason you note that your wakatime plugin is not working take a look at the logs of the auto installation at the .wakatime directory on your user's profile path, something like that: C:\Users\diego.garcia.wakatime\install.log also certify that your windows have PowerShell installed on it as the auto-install/update relies on it.

Manual installation

1- Create a directory named .wakatime on your current user profile directory "C:\Users\diego.garcia\.wakatime"

2- Download the wakatime-cli for Windows from the wakatime-cli github direct link here

3- Extract into the .wakatime directory and rename the file to wakatime-cli.exe

Possible Improvements

1- Add support to IOTAFormNotifier and send the heartbeat on form save or changed. It doesn't affect anything now but I have to test it to see if it is worth implementing it.

2- Add an inno setup installer to simplify the process of installing.

3- Add to some package manager?

delphi-wakatime's People

Contributors

alanhamlett avatar diegomgarcia avatar mobius1qwe avatar shaunroselt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

delphi-wakatime's Issues

Access Violation on IDE exit

Describe the bug
When exiting Delphi's IDE an Access Violation happens on rtlxxx.bpl where xxx represent delphi version. I haven't found out yet the source of the issue, apparently wakatime isn't being unloaded properly or maybe the threaded timer isn't finishing before the unload of the IDE.

To Reproduce
Steps to reproduce the behavior:

  1. install wakatime
  2. run IDE
  3. Exit IDE

Desktop (please complete the following information):

  • OS: Windows 10 x64
  • Delphi Version: 11.3

Wakatime not working on Delphi 11.3 Alexandria

Describe the bug
After adjusting the source code, the include file, the version number of the latest released wakatime-cli (1.73.1 x64 for me), creating the package, building it and installing on the IDE, inputting the token, all steps following the guide under README.md, toggled the waka form on debug mode to list everything on the log, it doesn't show errors but doesn't send anything to the wakatime dashboard either.

I also tried using the 32 bit client of windows thinking it could be something about the bitness but still nothing.

To Reproduce
Steps to reproduce the behavior:

  1. install Delphi 11.3,
  2. follow the steps of the README.md from this repository,
  3. toggle debug mode on the wakatime form under IDE
  4. do something with some project,
  5. open your wakatime account on the dashboard page
  6. nothing will show, saying that nothing was received by the plugin.

Expected behavior
at least a response message from wakatime-cli to understand what kind of error happened and how to fix it or not getting any messages but the dashboard or anywhere in the website would show what happened, either error or success.

Desktop (please complete the following information):

  • OS: Windows 10 22H2 x64
  • Delphi Version: Delphi 11.3 Alexandria

Additional Information
If needed I can send a Pull Request with the packages that I've made to install the client.

Memory Leak with Delphi 11.3

Describe the bug
Internal memory leak with wakatime client invokes. After some hours with the IDE opened it starts invoking a huge ammount of wakatime-cli instances, over 25 per second, which eats all the system's processor and memory, to fix you need to close all delphi instances and open again. I call this "internal leak".

Happens with me on 11.3

To Reproduce
Steps to reproduce the behavior:

  1. Install wakatime (ofc)
  2. open a project and work on it for a few hours (6+)
  3. type or save the current file (ctrl+S) or ident-and-save (Ctrl+D+S)
  4. See error

Expected behavior
not eat all my CPU would be nice.

Desktop (please complete the following information):

  • OS: Windows 10
  • Delphi Version: 11.3 Alexandria

Invalid Pointer Operation on IDE Exit

Describe the bug
After opening a multi-device project, closing the IDE, it throws an error of Invalid Pointer Operation. Regular VCL application the issue didn't happen with me

To Reproduce
Steps to reproduce the behavior:

  1. Do all the steps to install and configure wakatime and restart IDE
  2. Open any FMX project, old or new (multi device application)
  3. Close IDE without closing project
  4. See error.

Desktop (please complete the following information):

  • OS: Windows 10 x64 22H2 (MS didn't release 23H1 for me yet)
  • Delphi Version: 11.3 upd1

Adicionar suporte ao Delphi 10 Seattle

Adicionar suporte ao Delphi 10 Seattle

Criar pacote na versão Delphi 10 Seattle e disponibilizar.

Obs: Estou criado a issue para realizar o PR com a inclusão do pacote para o Delphi 10.

GetIt install fails

When I try to install it via GetIt on RAD Studio 11, then I get this error:

image

And it simply fails then:

image

So I can't get it installed.

C++ Builder Support

Describe the bug
I installed this into my RAD Studio IDE and it works fine for Delphi and C++. When I use Delphi files, then it shows I am using Delphi and when I use C++ files, then it says I am using C++.

But the issue is with the Editor. It says I am using Delphi for both Delphi and C++. It should say C++ Builder as my Editor when I'm using C++ files.

To Reproduce
Steps to reproduce the behavior:

  1. Work on any C++ Builder Project

Expected behavior
I would expect my Editor to be C++ Builder, but I only see Delphi:
image

Precisa de ajuda para incluir no Get It Package Manager?

Oi Diego, Adriano Santos aqui, talvez não me conheça.
Muito legal o projeto hein?

Cara, seria legal incluir seu projeto no Git It Package Manager, se precisar de ajuda, dá um toque. Me coloco à sua disposição pra ajudar.

Parabéns.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.