Skip to content

Conversation

bric3
Copy link
Contributor

@bric3 bric3 commented Sep 28, 2024

Moves the core sources to a mockito-core module, this has several benefits mentioned in #3444

  1. Improves the mental model of the project, in a multi-module project it is weird (if not confusing) to have the main sources in the root project.
  2. This aligns well with the practices seen on other notable projects.
  3. Improves the build configuration separation of concerns, before all projects and the mockito core were configured in the root build.gradle.

With this change the structure will look like

├── ./mockito-bom
├── ./mockito-core
└── ./mockito-extensions
│   ├── ./...
│   └── ./subclass-mockmacker 
└── ./mockito-integration-tests
    ├── ...
    └── ./java-21-tests

Previous history is possible using git --follow, IJ does that automatically (you can also click the colored line on the left the file history to expand the name).

Fixes #3444

Checklist

  • Read the contributing guide
  • PR should be motivated, i.e. what does it fix, why, and if relevant how
  • If possible / relevant include an example in the description, that could help all readers
    including project members to get a better picture of the change
  • Avoid other runtime dependencies
  • Meaningful commit history ; intention is important please rebase your commit history so that each
    commit is meaningful and help the people that will explore a change in 2 years
  • The pull request follows coding style
  • Mention Fixes #<issue number> in the description if relevant
  • At least one commit should mention Fixes #<issue number> if relevant

@bric3 bric3 marked this pull request as draft September 28, 2024 11:26
@codecov-commenter
Copy link

codecov-commenter commented Sep 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.76%. Comparing base (39a0c75) to head (f167a4e).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #3453   +/-   ##
=========================================
  Coverage     85.76%   85.76%           
  Complexity     2950     2950           
=========================================
  Files           339      339           
  Lines          8941     8941           
  Branches       1117     1117           
=========================================
  Hits           7668     7668           
  Misses          984      984           
  Partials        289      289           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bric3 bric3 force-pushed the move-to-core-module branch 4 times, most recently from 4c4a8d9 to 6641c7b Compare September 30, 2024 08:17
@bric3
Copy link
Contributor Author

bric3 commented Sep 30, 2024

After a ./gradlew publishToMavenLocal

/Users/brice.dutheil/.m2/repository/org/mockito/
├── mockito-android
│   ├── 5.14.2-SNAPSHOT
│   │   ├── maven-metadata-local.xml
│   │   ├── mockito-android-5.14.2-SNAPSHOT-javadoc.jar
│   │   ├── mockito-android-5.14.2-SNAPSHOT-sources.jar
│   │   ├── mockito-android-5.14.2-SNAPSHOT.jar
│   │   └── mockito-android-5.14.2-SNAPSHOT.pom
│   └── maven-metadata-local.xml
├── mockito-bom
│   ├── 5.14.2-SNAPSHOT
│   │   ├── maven-metadata-local.xml
│   │   └── mockito-bom-5.14.2-SNAPSHOT.pom
│   └── maven-metadata-local.xml
├── mockito-core
│   ├── 5.14.2-SNAPSHOT
│   │   ├── maven-metadata-local.xml
│   │   ├── mockito-core-5.14.2-SNAPSHOT-javadoc.jar
│   │   ├── mockito-core-5.14.2-SNAPSHOT-sources.jar
│   │   ├── mockito-core-5.14.2-SNAPSHOT.jar
│   │   └── mockito-core-5.14.2-SNAPSHOT.pom
│   └── maven-metadata-local.xml
├── mockito-errorprone
│   ├── 5.14.2-SNAPSHOT
│   │   ├── maven-metadata-local.xml
│   │   ├── mockito-errorprone-5.14.2-SNAPSHOT-javadoc.jar
│   │   ├── mockito-errorprone-5.14.2-SNAPSHOT-sources.jar
│   │   ├── mockito-errorprone-5.14.2-SNAPSHOT.jar
│   │   └── mockito-errorprone-5.14.2-SNAPSHOT.pom
│   └── maven-metadata-local.xml
├── mockito-junit-jupiter
│   ├── 5.14.2-SNAPSHOT
│   │   ├── maven-metadata-local.xml
│   │   ├── mockito-junit-jupiter-5.14.2-SNAPSHOT-javadoc.jar
│   │   ├── mockito-junit-jupiter-5.14.2-SNAPSHOT-sources.jar
│   │   ├── mockito-junit-jupiter-5.14.2-SNAPSHOT.jar
│   │   └── mockito-junit-jupiter-5.14.2-SNAPSHOT.pom
│   └── maven-metadata-local.xml
├── mockito-proxy
│   ├── 5.14.2-SNAPSHOT
│   │   ├── maven-metadata-local.xml
│   │   ├── mockito-proxy-5.14.2-SNAPSHOT-javadoc.jar
│   │   ├── mockito-proxy-5.14.2-SNAPSHOT-sources.jar
│   │   ├── mockito-proxy-5.14.2-SNAPSHOT.jar
│   │   └── mockito-proxy-5.14.2-SNAPSHOT.pom
│   └── maven-metadata-local.xml
└── mockito-subclass
    ├── 5.14.2-SNAPSHOT
    │   ├── maven-metadata-local.xml
    │   ├── mockito-subclass-5.14.2-SNAPSHOT-javadoc.jar
    │   ├── mockito-subclass-5.14.2-SNAPSHOT-sources.jar
    │   ├── mockito-subclass-5.14.2-SNAPSHOT.jar
    │   └── mockito-subclass-5.14.2-SNAPSHOT.pom
    └── maven-metadata-local.xml

Manifest (agent and osgi properties):

Manifest-Version: 1.0
Automatic-Module-Name: org.mockito
Bundle-ManifestVersion: 2
Bundle-Name: Mockito Mock Library for Java. Core bundle requires Byte 
 Buddy and Objenesis.
Bundle-SymbolicName: org.mockito.mockito-core
Bundle-Version: 5.14.2.SNAPSHOT
Can-Retransform-Classes: true
Export-Package: org.mockito.internal;status=INTERNAL;mandatory:=status
 ;version="5.14.2.SNAPSHOT";uses:="org.mockito,org.mockito.internal.ve
 rification.api,org.mockito.invocation,org.mockito.plugins,org.mockito
 .quality,org.mockito.stubbing,org.mockito.verification",org.mockito.i
 nternal.configuration;status=INTERNAL;mandatory:=status;version="5.14
 .2.SNAPSHOT";uses:="org.mockito,org.mockito.configuration,org.mockito
 .internal.util,org.mockito.plugins,org.mockito.stubbing",org.mockito.
 internal.configuration.injection;status=INTERNAL;mandatory:=status;ve
 rsion="5.14.2.SNAPSHOT",org.mockito.internal.configuration.injection.
 filter;status=INTERNAL;mandatory:=status;version="5.14.2.SNAPSHOT",or
 g.mockito.internal.configuration.injection.scanner;status=INTERNAL;ma
 ndatory:=status;version="5.14.2.SNAPSHOT",org.mockito.internal.config
 uration.plugins;status=INTERNAL;mandatory:=status;version="5.14.2.SNA
 PSHOT";uses:="org.mockito.plugins",org.mockito.internal.creation;stat
 us=INTERNAL;mandatory:=status;version="5.14.2.SNAPSHOT";uses:="org.mo
 ckito,org.mockito.internal.creation.settings,org.mockito.internal.inv
 ocation,org.mockito.listeners,org.mockito.mock,org.mockito.quality,or
 g.mockito.stubbing",org.mockito.internal.creation.bytebuddy;status=IN
 TERNAL;mandatory:=status;version="5.14.2.SNAPSHOT";uses:="net.bytebud
 dy.description.method,net.bytebuddy.dynamic.loading,net.bytebuddy.imp
 lementation.bind.annotation,net.bytebuddy.matcher,org.mockito,org.moc
 kito.creation.instance,org.mockito.internal.creation.bytebuddy.inject
 ,org.mockito.internal.util.concurrent,org.mockito.invocation,org.mock
 ito.mock,org.mockito.plugins",org.mockito.internal.creation.bytebuddy
 .inject;status=INTERNAL;mandatory:=status;version="5.14.2.SNAPSHOT",o
 rg.mockito.internal.creation.instance;status=INTERNAL;mandatory:=stat
 us;version="5.14.2.SNAPSHOT";uses:="org.mockito.creation.instance,org
 .mockito.mock,org.mockito.plugins",org.mockito.internal.creation.prox
 y;status=INTERNAL;mandatory:=status;version="5.14.2.SNAPSHOT";uses:="
 org.mockito.invocation,org.mockito.mock,org.mockito.plugins",org.mock
 ito.internal.creation.settings;status=INTERNAL;mandatory:=status;vers
 ion="5.14.2.SNAPSHOT";uses:="org.mockito.listeners,org.mockito.mock,o
 rg.mockito.quality,org.mockito.stubbing",org.mockito.internal.creatio
 n.util;status=INTERNAL;mandatory:=status;version="5.14.2.SNAPSHOT",or
 g.mockito.internal.debugging;status=INTERNAL;mandatory:=status;versio
 n="5.14.2.SNAPSHOT";uses:="org.mockito.internal.invocation,org.mockit
 o.invocation,org.mockito.listeners",org.mockito.internal.exceptions;s
 tatus=INTERNAL;mandatory:=status;version="5.14.2.SNAPSHOT";uses:="org
 .mockito.exceptions.base,org.mockito.exceptions.misusing,org.mockito.
 exceptions.verification,org.mockito.internal.matchers,org.mockito.int
 ernal.reporting,org.mockito.invocation,org.mockito.listeners,org.mock
 ito.mock",org.mockito.internal.exceptions.stacktrace;status=INTERNAL;
 mandatory:=status;version="5.14.2.SNAPSHOT";uses:="org.mockito.except
 ions.stacktrace,org.mockito.plugins",org.mockito.internal.exceptions.
 util;status=INTERNAL;mandatory:=status;version="5.14.2.SNAPSHOT";uses
 :="org.mockito.internal.exceptions",org.mockito.internal.framework;st
 atus=INTERNAL;mandatory:=status;version="5.14.2.SNAPSHOT";uses:="org.
 mockito,org.mockito.invocation,org.mockito.listeners,org.mockito.mock
 ,org.mockito.plugins,org.mockito.quality",org.mockito.internal.hamcre
 st;status=INTERNAL;mandatory:=status;version="5.14.2.SNAPSHOT";uses:=
 "org.hamcrest,org.mockito",org.mockito.internal.handler;status=INTERN
 AL;mandatory:=status;version="5.14.2.SNAPSHOT";uses:="org.mockito.inv
 ocation,org.mockito.listeners,org.mockito.mock",org.mockito.internal.
 invocation;status=INTERNAL;mandatory:=status;version="5.14.2.SNAPSHOT
 ";uses:="org.mockito,org.mockito.internal.exceptions,org.mockito.inte
 rnal.invocation.mockref,org.mockito.internal.progress,org.mockito.int
 ernal.verification.api,org.mockito.invocation,org.mockito.mock",org.m
 ockito.internal.invocation.finder;status=INTERNAL;mandatory:=status;v
 ersion="5.14.2.SNAPSHOT";uses:="org.mockito.invocation,org.mockito.st
 ubbing",org.mockito.internal.invocation.mockref;status=INTERNAL;manda
 tory:=status;version="5.14.2.SNAPSHOT",org.mockito.internal.junit;sta
 tus=INTERNAL;mandatory:=status;version="5.14.2.SNAPSHOT";uses:="org.j
 unit.runner,org.junit.runner.notification,org.junit.runners.model,org
 .mockito.exceptions.base,org.mockito.internal.listeners,org.mockito.i
 nvocation,org.mockito.junit,org.mockito.listeners,org.mockito.mock,or
 g.mockito.plugins,org.mockito.quality",org.mockito.internal.listeners
 ;status=INTERNAL;mandatory:=status;version="5.14.2.SNAPSHOT";uses:="o
 rg.mockito,org.mockito.internal.creation.settings,org.mockito.invocat
 ion,org.mockito.listeners,org.mockito.stubbing",org.mockito.internal.
 matchers;status=INTERNAL;mandatory:=status;version="5.14.2.SNAPSHOT";
 uses:="org.mockito,org.mockito.invocation",org.mockito.internal.match
 ers.apachecommons;status=INTERNAL;mandatory:=status;version="5.14.2.S
 NAPSHOT";uses:="org.mockito",org.mockito.internal.matchers.text;statu
 s=INTERNAL;mandatory:=status;version="5.14.2.SNAPSHOT";uses:="org.moc
 kito,org.mockito.internal.reporting",org.mockito.internal.progress;st
 atus=INTERNAL;mandatory:=status;version="5.14.2.SNAPSHOT";uses:="org.
 mockito,org.mockito.internal.matchers,org.mockito.listeners,org.mocki
 to.mock,org.mockito.stubbing,org.mockito.verification",org.mockito.in
 ternal.reporting;status=INTERNAL;mandatory:=status;version="5.14.2.SN
 APSHOT";uses:="org.mockito,org.mockito.invocation",org.mockito.intern
 al.runners;status=INTERNAL;mandatory:=status;version="5.14.2.SNAPSHOT
 ";uses:="org.junit.runner,org.junit.runner.manipulation,org.junit.run
 ner.notification,org.junit.runners.model,org.mockito.internal.junit,o
 rg.mockito.internal.util",org.mockito.internal.runners.util;status=IN
 TERNAL;mandatory:=status;version="5.14.2.SNAPSHOT";uses:="org.junit.r
 unner.notification,org.mockito.internal.runners",org.mockito.internal
 .session;status=INTERNAL;mandatory:=status;version="5.14.2.SNAPSHOT";
 uses:="org.mockito,org.mockito.plugins,org.mockito.quality,org.mockit
 o.session",org.mockito.internal.stubbing;status=INTERNAL;mandatory:=s
 tatus;version="5.14.2.SNAPSHOT";uses:="org.mockito.internal.invocatio
 n,org.mockito.invocation,org.mockito.mock,org.mockito.quality,org.moc
 kito.stubbing",org.mockito.internal.stubbing.answers;status=INTERNAL;
 mandatory:=status;version="5.14.2.SNAPSHOT";uses:="org.mockito.intern
 al.invocation,org.mockito.invocation,org.mockito.stubbing",org.mockit
 o.internal.stubbing.defaultanswers;status=INTERNAL;mandatory:=status;
 version="5.14.2.SNAPSHOT";uses:="org.mockito.internal.util.reflection
 ,org.mockito.invocation,org.mockito.stubbing",org.mockito.internal.ut
 il;status=INTERNAL;mandatory:=status;version="5.14.2.SNAPSHOT";uses:=
 "org.mockito,org.mockito.internal.stubbing,org.mockito.invocation,org
 .mockito.mock,org.mockito.plugins,org.mockito.stubbing",org.mockito.i
 nternal.util.collections;status=INTERNAL;mandatory:=status;version="5
 .14.2.SNAPSHOT",org.mockito.internal.util.concurrent;status=INTERNAL;
 mandatory:=status;version="5.14.2.SNAPSHOT",org.mockito.internal.util
 .io;status=INTERNAL;mandatory:=status;version="5.14.2.SNAPSHOT",org.m
 ockito.internal.util.reflection;status=INTERNAL;mandatory:=status;ver
 sion="5.14.2.SNAPSHOT";uses:="org.mockito.plugins",org.mockito.intern
 al.verification;status=INTERNAL;mandatory:=status;version="5.14.2.SNA
 PSHOT";uses:="org.mockito.internal,org.mockito.internal.invocation,or
 g.mockito.internal.stubbing,org.mockito.internal.util,org.mockito.int
 ernal.verification.api,org.mockito.invocation,org.mockito.listeners,o
 rg.mockito.verification",org.mockito.internal.verification.api;status
 =INTERNAL;mandatory:=status;version="5.14.2.SNAPSHOT";uses:="org.mock
 ito.invocation",org.mockito.internal.verification.argumentmatching;st
 atus=INTERNAL;mandatory:=status;version="5.14.2.SNAPSHOT";uses:="org.
 mockito",org.mockito.internal.verification.checkers;status=INTERNAL;m
 andatory:=status;version="5.14.2.SNAPSHOT";uses:="org.mockito.interna
 l.reporting,org.mockito.internal.verification.api,org.mockito.invocat
 ion",org.mockito;version="5.14.2.SNAPSHOT";uses:="org.mockito.excepti
 ons.misusing,org.mockito.invocation,org.mockito.listeners,org.mockito
 .mock,org.mockito.plugins,org.mockito.quality,org.mockito.session,org
 .mockito.stubbing,org.mockito.verification",org.mockito.codegen;versi
 on="5.14.2.SNAPSHOT",org.mockito.configuration;version="5.14.2.SNAPSH
 OT";uses:="org.mockito.stubbing",org.mockito.creation.instance;versio
 n="5.14.2.SNAPSHOT";uses:="org.mockito.exceptions.base",org.mockito.e
 xceptions.base;version="5.14.2.SNAPSHOT",org.mockito.exceptions.misus
 ing;version="5.14.2.SNAPSHOT";uses:="org.mockito.exceptions.base",org
 .mockito.exceptions.stacktrace;version="5.14.2.SNAPSHOT",org.mockito.
 exceptions.verification;version="5.14.2.SNAPSHOT";uses:="org.mockito.
 exceptions.base",org.mockito.exceptions.verification.junit;version="5
 .14.2.SNAPSHOT";uses:="junit.framework",org.mockito.exceptions.verifi
 cation.opentest4j;version="5.14.2.SNAPSHOT";uses:="org.opentest4j",or
 g.mockito.hamcrest;version="5.14.2.SNAPSHOT";uses:="org.hamcrest",org
 .mockito.invocation;version="5.14.2.SNAPSHOT";uses:="org.mockito,org.
 mockito.mock",org.mockito.junit;version="5.14.2.SNAPSHOT";uses:="org.
 junit.rules,org.junit.runner,org.junit.runner.manipulation,org.junit.
 runner.notification,org.mockito.exceptions.base,org.mockito.quality",
 org.mockito.listeners;version="5.14.2.SNAPSHOT";uses:="org.mockito.in
 vocation,org.mockito.mock,org.mockito.stubbing,org.mockito.verificati
 on",org.mockito.mock;version="5.14.2.SNAPSHOT";uses:="org.mockito,org
 .mockito.listeners,org.mockito.quality,org.mockito.stubbing",org.mock
 ito.plugins;version="5.14.2.SNAPSHOT";uses:="org.mockito,org.mockito.
 creation.instance,org.mockito.exceptions.stacktrace,org.mockito.invoc
 ation,org.mockito.mock",org.mockito.quality;version="5.14.2.SNAPSHOT"
 ,org.mockito.session;version="5.14.2.SNAPSHOT";uses:="org.mockito,org
 .mockito.exceptions.misusing,org.mockito.quality",org.mockito.stubbin
 g;version="5.14.2.SNAPSHOT";uses:="org.mockito,org.mockito.invocation
 ,org.mockito.quality",org.mockito.verification;version="5.14.2.SNAPSH
 OT";uses:="org.mockito.internal.verification,org.mockito.internal.ver
 ification.api"
Import-Package: net.bytebuddy;version="[1.6.0,2.0)",net.bytebuddy.agen
 t;version="[1.6.0,2.0)",net.bytebuddy.asm;version="[1.6.0,2.0)",net.b
 ytebuddy.description;version="[1.6.0,2.0)",net.bytebuddy.description.
 field;version="[1.6.0,2.0)",net.bytebuddy.description.method;version=
 "[1.6.0,2.0)",net.bytebuddy.description.modifier;version="[1.6.0,2.0)
 ",net.bytebuddy.description.type;version="[1.6.0,2.0)",net.bytebuddy.
 dynamic;version="[1.6.0,2.0)",net.bytebuddy.dynamic.loading;version="
 [1.6.0,2.0)",net.bytebuddy.dynamic.scaffold;version="[1.6.0,2.0)",net
 .bytebuddy.dynamic.scaffold.subclass;version="[1.6.0,2.0)",net.bytebu
 ddy.implementation;version="[1.6.0,2.0)",net.bytebuddy.implementation
 .attribute;version="[1.6.0,2.0)",net.bytebuddy.implementation.bind.an
 notation;version="[1.6.0,2.0)",net.bytebuddy.implementation.bytecode;
 version="[1.6.0,2.0)",net.bytebuddy.implementation.bytecode.assign;ve
 rsion="[1.6.0,2.0)",net.bytebuddy.jar.asm;version="[1.6.0,2.0)",net.b
 ytebuddy.matcher;version="[1.6.0,2.0)",net.bytebuddy.pool;version="[1
 .6.0,2.0)",net.bytebuddy.utility;version="[1.6.0,2.0)",junit.framewor
 k;resolution:=optional,org.junit;resolution:=optional,org.junit.rules
 ;resolution:=optional,org.junit.runner;resolution:=optional,org.junit
 .runner.manipulation;resolution:=optional,org.junit.runner.notificati
 on;resolution:=optional,org.junit.runners;resolution:=optional,org.ju
 nit.runners.model;resolution:=optional,org.hamcrest;resolution:=optio
 nal;version="[3.0,4)",org.objenesis;version="[3.1,4.0)",org.opentest4
 j;resolution:=optional;version="[1.3,2)",org.mockito;version="[5.14,6
 )",org.mockito.codegen;version="[5.14,6)",org.mockito.configuration;v
 ersion="[5.14,6)",org.mockito.creation.instance;version="[5.14,6)",or
 g.mockito.exceptions.base;version="[5.14,6)",org.mockito.exceptions.m
 isusing;version="[5.14,6)",org.mockito.exceptions.stacktrace;version=
 "[5.14,6)",org.mockito.exceptions.verification;version="[5.14,6)",org
 .mockito.exceptions.verification.junit;version="[5.14,6)",org.mockito
 .exceptions.verification.opentest4j;version="[5.14,6)",org.mockito.in
 ternal;version="[5.14,6)";status=INTERNAL,org.mockito.internal.config
 uration;version="[5.14,6)";status=INTERNAL,org.mockito.internal.confi
 guration.injection;version="[5.14,6)";status=INTERNAL,org.mockito.int
 ernal.configuration.injection.filter;version="[5.14,6)";status=INTERN
 AL,org.mockito.internal.configuration.injection.scanner;version="[5.1
 4,6)";status=INTERNAL,org.mockito.internal.configuration.plugins;vers
 ion="[5.14,6)";status=INTERNAL,org.mockito.internal.creation;version=
 "[5.14,6)";status=INTERNAL,org.mockito.internal.creation.bytebuddy;ve
 rsion="[5.14,6)";status=INTERNAL,org.mockito.internal.creation.bytebu
 ddy.inject;version="[5.14,6)";status=INTERNAL,org.mockito.internal.cr
 eation.instance;version="[5.14,6)";status=INTERNAL,org.mockito.intern
 al.creation.settings;version="[5.14,6)";status=INTERNAL,org.mockito.i
 nternal.debugging;version="[5.14,6)";status=INTERNAL,org.mockito.inte
 rnal.exceptions;version="[5.14,6)";status=INTERNAL,org.mockito.intern
 al.exceptions.stacktrace;version="[5.14,6)";status=INTERNAL,org.mocki
 to.internal.exceptions.util;version="[5.14,6)";status=INTERNAL,org.mo
 ckito.internal.framework;version="[5.14,6)";status=INTERNAL,org.mocki
 to.internal.hamcrest;version="[5.14,6)";status=INTERNAL,org.mockito.i
 nternal.handler;version="[5.14,6)";status=INTERNAL,org.mockito.intern
 al.invocation;version="[5.14,6)";status=INTERNAL,org.mockito.internal
 .invocation.finder;version="[5.14,6)";status=INTERNAL,org.mockito.int
 ernal.invocation.mockref;version="[5.14,6)";status=INTERNAL,org.mocki
 to.internal.junit;version="[5.14,6)";status=INTERNAL,org.mockito.inte
 rnal.listeners;version="[5.14,6)";status=INTERNAL,org.mockito.interna
 l.matchers;version="[5.14,6)";status=INTERNAL,org.mockito.internal.ma
 tchers.apachecommons;version="[5.14,6)";status=INTERNAL,org.mockito.i
 nternal.matchers.text;version="[5.14,6)";status=INTERNAL,org.mockito.
 internal.progress;version="[5.14,6)";status=INTERNAL,org.mockito.inte
 rnal.reporting;version="[5.14,6)";status=INTERNAL,org.mockito.interna
 l.runners;version="[5.14,6)";status=INTERNAL,org.mockito.internal.run
 ners.util;version="[5.14,6)";status=INTERNAL,org.mockito.internal.ses
 sion;version="[5.14,6)";status=INTERNAL,org.mockito.internal.stubbing
 ;version="[5.14,6)";status=INTERNAL,org.mockito.internal.stubbing.ans
 wers;version="[5.14,6)";status=INTERNAL,org.mockito.internal.stubbing
 .defaultanswers;version="[5.14,6)";status=INTERNAL,org.mockito.intern
 al.util;version="[5.14,6)";status=INTERNAL,org.mockito.internal.util.
 collections;version="[5.14,6)";status=INTERNAL,org.mockito.internal.u
 til.concurrent;version="[5.14,6)";status=INTERNAL,org.mockito.interna
 l.util.io;version="[5.14,6)";status=INTERNAL,org.mockito.internal.uti
 l.reflection;version="[5.14,6)";status=INTERNAL,org.mockito.internal.
 verification;version="[5.14,6)";status=INTERNAL,org.mockito.internal.
 verification.api;version="[5.14,6)";status=INTERNAL,org.mockito.inter
 nal.verification.argumentmatching;version="[5.14,6)";status=INTERNAL,
 org.mockito.internal.verification.checkers;version="[5.14,6)";status=
 INTERNAL,org.mockito.invocation;version="[5.14,6)",org.mockito.junit;
 version="[5.14,6)",org.mockito.listeners;version="[5.14,6)",org.mocki
 to.mock;version="[5.14,6)",org.mockito.plugins;version="[5.14,6)",org
 .mockito.quality;version="[5.14,6)",org.mockito.session;version="[5.1
 4,6)",org.mockito.stubbing;version="[5.14,6)",org.mockito.verificatio
 n;version="[5.14,6)"
Premain-Class: org.mockito.internal.PremainAttach
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=11))"

Javadoc looks fine too.

@bric3 bric3 marked this pull request as ready for review September 30, 2024 19:00
@bric3 bric3 requested review from raphw and TimvdLippe September 30, 2024 19:01
@TimvdLippe
Copy link
Contributor

We currently name our folders without the mockito- prefix in the extensions folder. In our top-level we do have the prefix. To keep things consistent, I would say we should name the folder core since the prefix is implied. Otherwise, I would expect the android folder to be named mockito-android. WDYT?

@bric3
Copy link
Contributor Author

bric3 commented Sep 30, 2024

I pondered on that, I thought it was better to have the top level projects starting with mockito-. E.g. if we use core, then it would be placed after the config folder but before the doc and gradle folders (and before the other mockito- top level folders), which I thought not wrong but odd.

I don't have opinions on our extension folders though, so I'm ok as it is or to rename them as mockito-android.

@raphw
Copy link
Member

raphw commented Oct 2, 2024

I agree it should be consistent. A newcomer might otherwise always wonder. Either way works for me.

@TimvdLippe
Copy link
Contributor

To make reviewing this easier, let's decide on a folder structure for the extensions and land that in a separate PR.

I personally don't mind our sources folders order to be mixed with other configuration, but I do also appreciate the grouping. Given the option, I do agree with the proposal that all projects are prefixed with mockito-. Do we also want that for mockito-extensions, given that is not a published artifact?

While these are mostly philosophical questions, I think we should list the options, make a decision and move on. Ultimately I don't think there is a perfect option, so let's be pragmatic as well. But I do want us to make a decision before we move, as we already have moved the folder structure for extensions and now do it again. Let's try to keep our git history as clean as we can, avoiding multiple moves.

@TimvdLippe
Copy link
Contributor

@bric3 Can you please update the wording of the commit messages to follow the structure we use for the other commits?

Switch Gradle Enterprise plugin to Develocity
Move core sources to `mockito-core`

Previously, the source code for the `mockito-core` artifact lived in
`/src/main/java` and the configuration was part of the `rootProject`.
With this change, we align the `mockito-core` as a separate artifact
similar to the recent move to split up the extension projects into
`mockito-extensions`.

Fixes #3444

apply from: 'gradle/shipkit.gradle'

apply from: 'gradle/root/ide.gradle'
apply from: 'gradle/root/gradle-fix.gradle'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see this file in either the rootProject or in mockito-core. Does that mean it is unused now and should we delete it? It seems like it should be part of the rootProject, but looking at the contents of the file, I am not sure if it is still relevant on recent versions of Gradle.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I didn't add the fix since it is not anymore necessary.
My plan is to drop this file in subsequent work on build scripts. I can do it now though.

@bric3
Copy link
Contributor Author

bric3 commented Oct 5, 2024

Can you please update the wording of the commit messages.

Ah yes, I'm using conventional commits in every day usage and didn't realize this didn't follow the convention there.

Edit : Done

bric3 added 3 commits October 5, 2024 22:38
Previously, the source code for the `mockito-core` artifact lived in
`/src/main/java` and the configuration was part of the `rootProject`.
With this change, we align the `mockito-core` as a separate artifact
similar to the recent move to split up the extension projects into
`mockito-extensions`.

Fixes #3444
As a follow-up to the split of `mockito-extensions` and `mockito-integration-tests`
this commit renames all extension projects to use the `mockito-` prefix. This way,
the project names reflect the published artifact ID's on Maven Central.
@bric3 bric3 force-pushed the move-to-core-module branch from 63a245c to b612b97 Compare October 5, 2024 20:41
@TimvdLippe TimvdLippe merged commit 560d855 into main Oct 6, 2024
18 checks passed
@TimvdLippe TimvdLippe deleted the move-to-core-module branch October 6, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move root project to dedicated core folder
4 participants