Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/conventional-commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Validate Conventional Commits
uses: webiny/action-conventional-commits@v1.3.0
uses: webiny/action-conventional-commits@v1.4.2
6 changes: 3 additions & 3 deletions .github/workflows/melpazoid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Set up Python 3.10
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: "3.10"

Expand All @@ -26,7 +26,7 @@ jobs:
- name: Run melpazoid
env:
LOCAL_REPO: ${{ github.workspace }}
RECIPE: (java-agent-loader :fetcher github :repo "saulotoledo/java-agent-loader")
RECIPE: (jal :fetcher github :repo "saulotoledo/java-agent-loader")
# Change to true when the package is already in MELPA:
EXIST_OK: false
run: echo $GITHUB_REF && make -C ~/melpazoid
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test: compile ert
ert:
$(EMACS) -Q -batch \
-L $(JAL_DIR) \
-l $(JAL_DIR)tests/java-agent-loader-test.el \
-l $(JAL_DIR)tests/jal-test.el \
-f ert-run-tests-batch-and-exit

clean-elc:
Expand Down
2 changes: 1 addition & 1 deletion README.org
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ No clone needed: Emacs fetches the package directly from GitHub:

#+begin_src elisp
(straight-use-package
'(java-agent-loader :type git :host github :repo "saulotoledo/java-agent-loader"))
'(jal :type git :host github :repo "saulotoledo/java-agent-loader"))
#+end_src

** Configuration
Expand Down
31 changes: 16 additions & 15 deletions java-agent-loader-build-gradle.el → jal-build-gradle.el
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
;;; java-agent-loader-build-gradle.el --- Gradle detection for Java Agent Loader -*- lexical-binding: t; -*-
;;; jal-build-gradle.el --- Gradle detection for Java Agent Loader (JAL) -*- lexical-binding: t; -*-

;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is free software: you can redistribute it and/or modify it under
;; the terms of the GNU General Public License as published by the Free Software
;; Foundation, either version 3 of the License, or (at your option) any later
;; version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; This program is distributed in the hope that it will be useful, but WITHOUT
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
;; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
;; details.

;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;; You should have received a copy of the GNU General Public License along with
;; this program. If not, see <https://www.gnu.org/licenses/>.

;; Author: Saulo Toledo <saulotoledo@gmail.com>

;;; Commentary:
;; Gradle detection logic for JAL.

;; Gradle detection logic for Java Agent Loader (JAL).

;;; Code:

(require 'java-agent-loader-utils)
(require 'jal-utils)

(defun jal--gradle-write-init-script (agents-list)
"Write a Gradle init script that lists resolved jars for AGENTS-LIST.
Expand Down Expand Up @@ -130,5 +131,5 @@ or nil on failure."
(funcall callback (nreverse found-agents))))))))))))


(provide 'java-agent-loader-build-gradle)
;;; java-agent-loader-build-gradle.el ends here
(provide 'jal-build-gradle)
;;; jal-build-gradle.el ends here
29 changes: 15 additions & 14 deletions java-agent-loader-build-maven.el → jal-build-maven.el
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
;;; java-agent-loader-build-maven.el --- Maven detection for Java Agent Loader -*- lexical-binding: t; -*-
;;; jal-build-maven.el --- Maven detection for Java Agent Loader (JAL) -*- lexical-binding: t; -*-

;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is free software: you can redistribute it and/or modify it under
;; the terms of the GNU General Public License as published by the Free Software
;; Foundation, either version 3 of the License, or (at your option) any later
;; version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; This program is distributed in the hope that it will be useful, but WITHOUT
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
;; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
;; details.

;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;; You should have received a copy of the GNU General Public License along with
;; this program. If not, see <https://www.gnu.org/licenses/>.

;; Author: Saulo Toledo <saulotoledo@gmail.com>

;;; Commentary:

;; Maven detection logic for JAL.

;;; Code:

(require 'java-agent-loader-utils)
(require 'jal-utils)

(defun jal--maven-extract-agent-dependency-info (mvn-output agent-id)
"Extract the maven agent AGENT-ID from MVN-OUTPUT.
Expand Down Expand Up @@ -143,5 +144,5 @@ or nil on failure."
(funcall callback (nreverse found-agents))))))))))))


(provide 'java-agent-loader-build-maven)
;;; java-agent-loader-build-maven.el ends here
(provide 'jal-build-maven)
;;; jal-build-maven.el ends here
42 changes: 22 additions & 20 deletions java-agent-loader-client-eglot.el → jal-client-eglot.el
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
;;; java-agent-loader-client-eglot.el --- eglot-java integration for JAL -*- lexical-binding: t; -*-
;;; jal-client-eglot.el --- eglot-java integration for Java Agent Loader (JAL) -*- lexical-binding: t; -*-

;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is free software: you can redistribute it and/or modify it under
;; the terms of the GNU General Public License as published by the Free Software
;; Foundation, either version 3 of the License, or (at your option) any later
;; version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; This program is distributed in the hope that it will be useful, but WITHOUT
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
;; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
;; details.

;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;; You should have received a copy of the GNU General Public License along with
;; this program. If not, see <https://www.gnu.org/licenses/>.

;; Author: Saulo Toledo <saulotoledo@gmail.com>

;;; Commentary:
;; This module provides integration between JAL and eglot-java.
;; It installs an around advice on `eglot-java--eclipse-jdt-contact' that
;; dynamically extends `eglot-java-eclipse-jdt-args' with the javaagent
;; arguments for the current project on every JDTLS startup.

;; This module provides integration between Java Agent Loader (JAL) and
;; `eglot-java'. It installs an around advice on
;; `eglot-java--eclipse-jdt-contact' that dynamically extends
;; `eglot-java-eclipse-jdt-args' with the javaagent arguments for the current
;; project on every JDTLS startup.

;;; Code:

(require 'java-agent-loader)
(require 'java-agent-loader-vars)
(require 'java-agent-loader-known-agents)
(require 'jal)
(require 'jal-vars)
(require 'jal-known-agents)

(defvar eglot-java-eclipse-jdt-args)

Expand Down Expand Up @@ -101,5 +103,5 @@ This function is called automatically when eglot-java is loaded."
(add-hook 'jal-agents-detected-hook #'jal--eglot-reconnect)
(setq jal--eglot-java-interface-warning-issued nil))

(provide 'java-agent-loader-client-eglot)
;;; java-agent-loader-client-eglot.el ends here
(provide 'jal-client-eglot)
;;; jal-client-eglot.el ends here
36 changes: 19 additions & 17 deletions java-agent-loader-client-lsp.el → jal-client-lsp.el
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
;;; java-agent-loader-client-lsp.el --- LSP-Java integration for JAL -*- lexical-binding: t; -*-
;;; jal-client-lsp.el --- LSP-Java integration for Java Agent Loader (JAL) -*- lexical-binding: t; -*-

;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is free software: you can redistribute it and/or modify it under
;; the terms of the GNU General Public License as published by the Free Software
;; Foundation, either version 3 of the License, or (at your option) any later
;; version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; This program is distributed in the hope that it will be useful, but WITHOUT
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
;; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
;; details.

;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;; You should have received a copy of the GNU General Public License along with
;; this program. If not, see <https://www.gnu.org/licenses/>.

;; Author: Saulo Toledo <saulotoledo@gmail.com>

;;; Commentary:
;; This module provides integration between JAL and lsp-java.

;; This module provides integration between Java Agent Loader (JAL) and
;; `lsp-java'.

;;; Code:

(require 'java-agent-loader)
(require 'java-agent-loader-vars)
(require 'java-agent-loader-known-agents)
(require 'jal)
(require 'jal-vars)
(require 'jal-known-agents)

(defvar lsp-java-vmargs)
(defvar lsp-java-java-path)
Expand Down Expand Up @@ -89,5 +91,5 @@ This function is called automatically when lsp-java is loaded."
(add-hook 'lsp-after-initialize-hook #'jal-find-and-configure-agents)
(add-hook 'jal-agents-detected-hook #'jal--lsp-java-restart))

(provide 'java-agent-loader-client-lsp)
;;; java-agent-loader-client-lsp.el ends here
(provide 'jal-client-lsp)
;;; jal-client-lsp.el ends here
45 changes: 45 additions & 0 deletions jal-known-agents.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
;;; jal-known-agents.el --- Known agents registry for Java Agent Loader (JAL) -*- lexical-binding: t; -*-

;; This program is free software: you can redistribute it and/or modify it under
;; the terms of the GNU General Public License as published by the Free Software
;; Foundation, either version 3 of the License, or (at your option) any later
;; version.

;; This program is distributed in the hope that it will be useful, but WITHOUT
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
;; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
;; details.

;; You should have received a copy of the GNU General Public License along with
;; this program. If not, see <https://www.gnu.org/licenses/>.

;; Author: Saulo Toledo <saulotoledo@gmail.com>

;;; Commentary:

;; This module provides a centralized registry of commonly used Java agents for
;; the Java Agent Loader (JAL) ecosystem, pre-configured with sensible default
;; options.
;;
;; Note that this registry is intentionally not exhaustive or complete. Users
;; can easily extend this list in their own configurations to support custom or
;; niche agents. Furthermore, contributions to add more standard agents to this
;; default registry are highly welcome to facilitate usage for the wider
;; community.

;;; Code:

(defvar jal-known-agents
'(
("lombok" :jar-path "org/projectlombok/%a/%v/%a-%v.jar" :params "")
("opentelemetry-javaagent" :jar-path "io/opentelemetry/javaagent/%a/%v/%a-%v.jar")
("org.jacoco.agent" :jar-path "org/jacoco/%a/%v/%a-%v-runtime.jar"))
"Registry of known Java agents with default configurations.
Each entry is either:
- (ARTIFACT-ID) : Use defaults
- (ARTIFACT-ID . PROPS) : Specify properties

PROPS is a plist with keys :params and :jar-path.")

(provide 'jal-known-agents)
;;; jal-known-agents.el ends here
33 changes: 17 additions & 16 deletions java-agent-loader-utils.el → jal-utils.el
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
;;; java-agent-loader-utils.el --- Utilities for Java Agent Loader -*- lexical-binding: t; -*-
;;; jal-utils.el --- Utilities for Java Agent Loader (JAL) -*- lexical-binding: t; -*-

;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is free software: you can redistribute it and/or modify it under
;; the terms of the GNU General Public License as published by the Free Software
;; Foundation, either version 3 of the License, or (at your option) any later
;; version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; This program is distributed in the hope that it will be useful, but WITHOUT
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
;; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
;; details.

;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;; You should have received a copy of the GNU General Public License along with
;; this program. If not, see <https://www.gnu.org/licenses/>.

;; Author: Saulo Toledo <saulotoledo@gmail.com>

;;; Commentary:
;; Utility functions for jal.

;; Utility functions for the Java Agent Loader (JAL).

;;; Code:

(require 'java-agent-loader-vars)
(require 'java-agent-loader-known-agents)
(require 'jal-vars)
(require 'jal-known-agents)
(require 'project)
(require 'format-spec)

Expand Down Expand Up @@ -205,5 +206,5 @@ in the new scoped format."
(when (jal--config-scoped-p full-config)
(cadr (assoc java-key full-config)))))))

(provide 'java-agent-loader-utils)
;;; java-agent-loader-utils.el ends here
(provide 'jal-utils)
;;; jal-utils.el ends here
Loading