Skip to content

Commit a7c1629

Browse files
authored
Merge pull request #33 from jcs-PR/test/eask
test: Build with Eask
2 parents 8a4eeea + bebbe50 commit a7c1629

File tree

10 files changed

+113
-26
lines changed

10 files changed

+113
-26
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: daily

.github/workflows/test.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
test:
16+
runs-on: ${{ matrix.os }}
17+
continue-on-error: ${{ matrix.experimental }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
os: [ubuntu-latest, macos-latest, windows-latest]
22+
emacs-version:
23+
- 26.3
24+
- 27.2
25+
- 28.2
26+
- 29.1
27+
experimental: [false]
28+
include:
29+
- os: ubuntu-latest
30+
emacs-version: snapshot
31+
experimental: true
32+
- os: macos-latest
33+
emacs-version: snapshot
34+
experimental: true
35+
- os: windows-latest
36+
emacs-version: snapshot
37+
experimental: true
38+
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- uses: jcs090218/setup-emacs@master
43+
with:
44+
version: ${{ matrix.emacs-version }}
45+
46+
- uses: emacs-eask/setup-eask@master
47+
with:
48+
version: 'snapshot'
49+
50+
- name: Run tests
51+
run: |
52+
eask package
53+
eask install
54+
eask compile

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*.info
44
*.texi
55
.cask
6+
.eask
67
dist
78

89
ede-php-autoload-autoloads.el

Eask

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
(package "ede-php-autoload"
2+
"1.1.0"
3+
"PHP autoloading implementation for Semantic")
4+
5+
(website-url "https://github.com/emacs-php/ede-php-autoload")
6+
(keywords "PHP" "project" "ede")
7+
8+
(package-file "ede-php-autoload.el")
9+
(files
10+
"*.el"
11+
"ede-php-autoload")
12+
13+
(script "test" "echo \"Error: no test specified\" && exit 1")
14+
15+
(source 'melpa)
16+
17+
(depends-on "emacs" "26.1")
18+
19+
(development
20+
(depends-on "ecukes")
21+
(depends-on "ert-runner")
22+
(depends-on "f")
23+
)
24+
25+
(setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432

ede-php-autoload.el

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
;; Author: Steven Rémot <[email protected]>
66
;; original code for C++ by Eric M. Ludlam <[email protected]>
7+
;; Version: 1.1.0
78
;; Keywords: PHP project ede
89
;; Homepage: https://github.com/emacs-php/ede-php-autoload
910

@@ -216,7 +217,7 @@ ROOT-DIR is the root directory of the project."
216217
:type list
217218
:documentation "The class autoloads explicitly defined at initialization")))
218219

219-
(defmethod initialize-instance ((this ede-php-autoload-project) &rest fields)
220+
(cl-defmethod initialize-instance ((this ede-php-autoload-project) &rest fields)
220221
"Make sure the :file is fully expanded."
221222
(call-next-method this (list
222223
:file (plist-get (car fields) :file)
@@ -245,7 +246,7 @@ ROOT-DIR is the root directory of the project."
245246
(unless (slot-boundp this 'targets)
246247
(oset this :targets nil))))
247248

248-
(defmethod ede-php-autoload-reload-autoloads-for-project ((this ede-php-autoload-project))
249+
(cl-defmethod ede-php-autoload-reload-autoloads-for-project ((this ede-php-autoload-project))
249250
"Regenerate the class loaders.
250251
251252
This can be used when some composer dependencies changed, to take
@@ -260,11 +261,11 @@ the new autoloads into account."
260261
(oset this class-loader
261262
(ede-php-autoload-create-class-loader cleaned-autoloads))))
262263

263-
(defmethod ede-find-subproject-for-directory ((proj ede-php-autoload-project) dir)
264+
(cl-defmethod ede-find-subproject-for-directory ((proj ede-php-autoload-project) dir)
264265
"Return PROJ, for handling all subdirs below DIR."
265266
proj)
266267

267-
(defmethod ede-find-target ((proj ede-php-autoload-project) buffer)
268+
(cl-defmethod ede-find-target ((proj ede-php-autoload-project) buffer)
268269
"Find an EDE target in PROJ for BUFFER.
269270
If one doesn't exist, create a new one for this directory."
270271
(let* ((targets (oref proj targets))
@@ -280,21 +281,21 @@ If one doesn't exist, create a new one for this directory."
280281
(object-add-to-list proj :targets ans))
281282
ans))
282283

283-
(defmethod ede-project-root ((this ede-php-autoload-project))
284+
(cl-defmethod ede-project-root ((this ede-php-autoload-project))
284285
"Return my root."
285286
this)
286287

287-
(defmethod ede-project-root-directory ((this ede-php-autoload-project))
288+
(cl-defmethod ede-project-root-directory ((this ede-php-autoload-project))
288289
"Return my root."
289290
(file-name-directory (oref this file)))
290291

291-
(defmethod ede-php-autoload-find-class-def-file ((this ede-php-autoload-project) class-name)
292+
(cl-defmethod ede-php-autoload-find-class-def-file ((this ede-php-autoload-project) class-name)
292293
"Find the file in which CLASS-NAME is defined.
293294
294295
CLASS-NAME must be the full name of the class, with all its parent namespaces."
295296
(ede-php-autoload-find-class-def-file (oref this class-loader) class-name))
296297

297-
(defmethod ede-php-autoload-get-class-name-for-file
298+
(cl-defmethod ede-php-autoload-get-class-name-for-file
298299
((this ede-php-autoload-project) file-name)
299300
"Generate a suitable class name for the current FILE-NAME.
300301
@@ -303,7 +304,7 @@ Generate this class name using the class loader information.
303304
FILE-NAME must be absolute or relative to the project root."
304305
(ede-php-autoload-get-class-name-for-file (oref this class-loader) file-name))
305306

306-
(defmethod ede-php-autoload-complete ((this ede-php-autoload-project) prefix)
307+
(cl-defmethod ede-php-autoload-complete ((this ede-php-autoload-project) prefix)
307308
"Get completion suggestions for the type PREFIX.
308309
309310
PREFIX is the beginning of a fully-qualified name.
@@ -312,7 +313,7 @@ The result is a list of completion suggestions for this
312313
prefix."
313314
(ede-php-autoload-complete (oref this class-loader) prefix))
314315

315-
(defmethod ede-php-autoload-complete-type-name ((this ede-php-autoload-project) prefix)
316+
(cl-defmethod ede-php-autoload-complete-type-name ((this ede-php-autoload-project) prefix)
316317
"Get completion suggestions for the type PREFIX.
317318
318319
PREFIX is the beginning of a fully-qualified name.

ede-php-autoload/class-loader/aggregate.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
They must be instances of `ede-php-autoload-class-loader'."))
3333
"An aggregation of several class loaders.")
3434

35-
(defmethod ede-php-autoload-find-class-def-file ((this ede-php-autoload-aggregate-class-loader)
35+
(cl-defmethod ede-php-autoload-find-class-def-file ((this ede-php-autoload-aggregate-class-loader)
3636
class-name)
3737
"Find the file in which CLASS-NAME is defined.
3838
@@ -44,7 +44,7 @@ Return nil if no file has been found."
4444
loaders (cdr loaders)))
4545
class-def-file))
4646

47-
(defmethod ede-php-autoload-get-class-name-for-file
47+
(cl-defmethod ede-php-autoload-get-class-name-for-file
4848
((this ede-php-autoload-aggregate-class-loader) file-name)
4949
"Generate a suitable class name for the current FILE-NAME.
5050
@@ -58,7 +58,7 @@ FILE-NAME must be absolute or relative to the project root."
5858
loaders (cdr loaders)))
5959
class-name))
6060

61-
(defmethod ede-php-autoload-complete-type-name ((this ede-php-autoload-aggregate-class-loader) prefix)
61+
(cl-defmethod ede-php-autoload-complete-type-name ((this ede-php-autoload-aggregate-class-loader) prefix)
6262
"Get completion suggestions for the type PREFIX.
6363
6464
PREFIX is the beginning of a fully-qualified name.

ede-php-autoload/class-loader/classmap.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@
4040
:documentation "A hash associating a class name and an absolute path to the file in whcih the class is defined."))
4141
"Class loader for direct association between classes and files.")
4242

43-
(defmethod ede-php-autoload-find-class-def-file ((this ede-php-autoload-classmap-class-loader) class-name)
43+
(cl-defmethod ede-php-autoload-find-class-def-file ((this ede-php-autoload-classmap-class-loader) class-name)
4444
"Find the file in which CLASS-NAME is defined.
4545
4646
Return nil if no file has been found."
4747
(let ((file (gethash class-name (oref this class-hash))))
4848
(when file
4949
(expand-file-name file (ede-project-root-directory (ede-current-project))))))
5050

51-
(defmethod ede-php-autoload-get-class-name-for-file ((this ede-php-autoload-classmap-class-loader) file-name)
51+
(cl-defmethod ede-php-autoload-get-class-name-for-file ((this ede-php-autoload-classmap-class-loader) file-name)
5252
"Generate a suitable class name for the current FILE-NAME.
5353
5454
Generate this class name using the class loader information.
@@ -63,7 +63,7 @@ FILE-NAME must be absolute or relative to the project root."
6363
(throw 'class-name class)))
6464
(oref this class-hash)))))
6565

66-
(defmethod ede-php-autoload-complete-type-name ((this ede-php-autoload-classmap-class-loader) prefix)
66+
(cl-defmethod ede-php-autoload-complete-type-name ((this ede-php-autoload-classmap-class-loader) prefix)
6767
"Get completion suggestions for the type PREFIX.
6868
6969
PREFIX is the beginning of a fully-qualified name.

ede-php-autoload/class-loader/core.el

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
"Base class for finding the file in with some class is defined."
3030
:abstract t)
3131

32-
(defmethod ede-php-autoload-find-class-def-file ((this ede-php-autoload-class-loader)
32+
(cl-defmethod ede-php-autoload-find-class-def-file ((this ede-php-autoload-class-loader)
3333
class-name)
3434
"Find the file in which CLASS-NAME is defined.
3535
3636
CLASS-NAME must be the full name of the class, with all its parent namespaces."
3737
(error "Method `ede-php-autoload-find-class-def-file' must be overriden"))
3838

39-
(defmethod ede-php-autoload-get-class-name-for-file
39+
(cl-defmethod ede-php-autoload-get-class-name-for-file
4040
((this ede-php-autoload-class-loader) file-name)
4141
"Generate a suitable class name for the current FILE-NAME.
4242
@@ -45,7 +45,7 @@ Generate this class name using the class loader information.
4545
FILE-NAME must be absolute or relative to the project root."
4646
(error "Method `ede-php-autoload-find-class-def-file' must be overriden"))
4747

48-
(defmethod ede-php-autoload-complete ((this ede-php-autoload-class-loader) prefix)
48+
(cl-defmethod ede-php-autoload-complete ((this ede-php-autoload-class-loader) prefix)
4949
"Get completion suggestions for the PREFIX.
5050
5151
PREFIX is the beginning of a fully-qualified name.
@@ -66,7 +66,7 @@ prefix."
6666
(cl-loop for completion in completions
6767
collect (concat ns "\\" completion)))))
6868

69-
(defmethod ede-php-autoload-complete-type-name ((this ede-php-autoload-class-loader) prefix)
69+
(cl-defmethod ede-php-autoload-complete-type-name ((this ede-php-autoload-class-loader) prefix)
7070
"Get type completion suggestions for the type PREFIX.
7171
7272
PREFIX is the beginning of a fully-qualified name.

ede-php-autoload/class-loader/psr0.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ then The class \"Bar_Foo\" is considered to be defined in \"src/test/Bar/Foo\".
4646
The include paths can be either a string or a list of strings."))
4747
"Class loader for PSR-0 convention.")
4848

49-
(defmethod ede-php-autoload-find-class-def-file ((this ede-php-autoload-psr0-class-loader)
49+
(cl-defmethod ede-php-autoload-find-class-def-file ((this ede-php-autoload-psr0-class-loader)
5050
class-name)
5151
"Find the file in which CLASS-NAME is defined.
5252
@@ -66,7 +66,7 @@ Return nil if no file has been found."
6666
(setq namespaces (cdr namespaces))))
6767
class-def-file))
6868

69-
(defmethod ede-php-autoload-get-class-name-for-file
69+
(cl-defmethod ede-php-autoload-get-class-name-for-file
7070
((this ede-php-autoload-psr0-class-loader) file-name)
7171
"Generate a suitable class name for the current FILE-NAME.
7272
@@ -137,7 +137,7 @@ PREFIX is the beginning of the type to complete."
137137
(car (last split-prefix)))))))))
138138
suggestions))
139139

140-
(defmethod ede-php-autoload-complete-type-name ((this ede-php-autoload-psr0-class-loader) prefix)
140+
(cl-defmethod ede-php-autoload-complete-type-name ((this ede-php-autoload-psr0-class-loader) prefix)
141141
"Get completion suggestions for the type PREFIX.
142142
143143
PREFIX is the beginning of a fully-qualified name.

ede-php-autoload/class-loader/psr4.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ For example, if :namespaces has the value '((\"Foo\" . \"src/Foo\") (\"Bar\" . \
4545
then The class \"Bar\\Foo\" is considered to be defined in \"src/test/Bar/Foo\"."))
4646
"Class loader for PSR-4 convention.")
4747

48-
(defmethod ede-php-autoload-find-class-def-file ((this ede-php-autoload-psr4-class-loader)
48+
(cl-defmethod ede-php-autoload-find-class-def-file ((this ede-php-autoload-psr4-class-loader)
4949
class-name)
5050
"Find the file in which CLASS-NAME is defined.
5151
@@ -88,7 +88,7 @@ TARGET is a string."
8888
(setq current-pairs (cdr current-pairs)))
8989
longest-pair))
9090

91-
(defmethod ede-php-autoload-get-class-name-for-file
91+
(cl-defmethod ede-php-autoload-get-class-name-for-file
9292
((this ede-php-autoload-psr4-class-loader) file-name)
9393
"Generate a suitable class name for the current FILE-NAME.
9494
@@ -158,7 +158,7 @@ PREFIX is the beginning of the type to complete."
158158
(car (last split-prefix)))))))))
159159
suggestions))
160160

161-
(defmethod ede-php-autoload-complete-type-name ((this ede-php-autoload-psr4-class-loader) prefix)
161+
(cl-defmethod ede-php-autoload-complete-type-name ((this ede-php-autoload-psr4-class-loader) prefix)
162162
"Get completion suggestions for the type PREFIX.
163163
164164
PREFIX is the beginning of a fully-qualified name.

0 commit comments

Comments
 (0)