@@ -1765,13 +1765,15 @@ public void extensionMetadata() throws Exception {
17651765 " ext," ,
17661766 " 'indirect_dep'," ,
17671767 " 'invalid_dep'," ,
1768+ " 'dev_as_non_dev_dep'," ,
17681769 " my_direct_dep = 'direct_dep'," ,
17691770 ")" ,
17701771 "ext_dev = use_extension('@ext//:defs.bzl', 'ext', dev_dependency = True)" ,
17711772 "use_repo(" ,
17721773 " ext_dev," ,
17731774 " 'indirect_dev_dep'," ,
17741775 " 'invalid_dev_dep'," ,
1776+ " 'non_dev_as_dev_dep'," ,
17751777 " my_direct_dev_dep = 'direct_dev_dep'," ,
17761778 ")" );
17771779 scratch .file (workspaceRoot .getRelative ("BUILD" ).getPathString ());
@@ -1800,9 +1802,12 @@ public void extensionMetadata() throws Exception {
18001802 " data_repo(name='missing_direct_dev_dep')" ,
18011803 " data_repo(name='indirect_dep')" ,
18021804 " data_repo(name='indirect_dev_dep')" ,
1805+ " data_repo(name='dev_as_non_dev_dep')" ,
1806+ " data_repo(name='non_dev_as_dev_dep')" ,
18031807 " return ctx.extension_metadata(" ,
1804- " root_module_direct_deps=['direct_dep', 'missing_direct_dep']," ,
1805- " root_module_direct_dev_deps=['direct_dev_dep', 'missing_direct_dev_dep']," ,
1808+ " root_module_direct_deps=['direct_dep', 'missing_direct_dep', 'non_dev_as_dev_dep']," ,
1809+ " root_module_direct_dev_deps=['direct_dev_dep', 'missing_direct_dev_dep',"
1810+ + " 'dev_as_non_dev_dep']," ,
18061811 " )" ,
18071812 "ext=module_extension(implementation=_ext_impl)" );
18081813
@@ -1826,19 +1831,28 @@ public void extensionMetadata() throws Exception {
18261831 + " build to fail):\n "
18271832 + " missing_direct_dep, missing_direct_dev_dep\n "
18281833 + "\n "
1834+ + "Imported as a regular dependency, but reported as a dev dependency by the"
1835+ + " extension (may cause the build to fail when used by other modules):\n "
1836+ + " dev_as_non_dev_dep\n "
1837+ + "\n "
1838+ + "Imported as a dev dependency, but reported as a regular dependency by the"
1839+ + " extension (may cause the build to fail when used by other modules):\n "
1840+ + " non_dev_as_dev_dep\n "
1841+ + "\n "
18291842 + "Imported, but reported as indirect dependencies by the extension:\n "
18301843 + " indirect_dep, indirect_dev_dep\n "
18311844 + "\n "
18321845 + "\033 [35m\033 [1m ** You can use the following buildozer command(s) to fix these"
18331846 + " issues:\033 [0m\n "
18341847 + "\n "
1835- + "buildozer 'use_repo_add @ext//:defs.bzl ext missing_direct_dep' //MODULE.bazel:all\n "
1836- + "buildozer 'use_repo_remove @ext//:defs.bzl ext indirect_dep invalid_dep'"
1837- + " //MODULE.bazel:all\n "
1838- + "buildozer 'use_repo_add dev @ext//:defs.bzl ext missing_direct_dev_dep'"
1848+ + "buildozer 'use_repo_add @ext//:defs.bzl ext missing_direct_dep non_dev_as_dev_dep'"
18391849 + " //MODULE.bazel:all\n "
1840- + "buildozer 'use_repo_remove dev @ext//:defs.bzl ext indirect_dev_dep invalid_dev_dep'"
1841- + " //MODULE.bazel:all" ,
1850+ + "buildozer 'use_repo_remove @ext//:defs.bzl ext dev_as_non_dev_dep"
1851+ + " indirect_dep invalid_dep' //MODULE.bazel:all\n "
1852+ + "buildozer 'use_repo_add dev @ext//:defs.bzl ext dev_as_non_dev_dep"
1853+ + " missing_direct_dev_dep' //MODULE.bazel:all\n "
1854+ + "buildozer 'use_repo_remove dev @ext//:defs.bzl ext indirect_dev_dep invalid_dev_dep"
1855+ + " non_dev_as_dev_dep' //MODULE.bazel:all" ,
18421856 ImmutableSet .of (EventKind .WARNING ));
18431857 }
18441858
@@ -1908,6 +1922,10 @@ public void extensionMetadata_all() throws Exception {
19081922 + " build to fail):\n "
19091923 + " missing_direct_dep, missing_direct_dev_dep\n "
19101924 + "\n "
1925+ + "Imported as a dev dependency, but reported as a regular dependency by the"
1926+ + " extension (may cause the build to fail when used by other modules):\n "
1927+ + " direct_dev_dep, indirect_dev_dep\n "
1928+ + "\n "
19111929 + "\033 [35m\033 [1m ** You can use the following buildozer command(s) to fix these"
19121930 + " issues:\033 [0m\n "
19131931 + "\n "
@@ -1987,6 +2005,10 @@ public void extensionMetadata_allDev() throws Exception {
19872005 + " build to fail):\n "
19882006 + " missing_direct_dep, missing_direct_dev_dep\n "
19892007 + "\n "
2008+ + "Imported as a regular dependency, but reported as a dev dependency by the"
2009+ + " extension (may cause the build to fail when used by other modules):\n "
2010+ + " direct_dep, indirect_dep\n "
2011+ + "\n "
19902012 + "\033 [35m\033 [1m ** You can use the following buildozer command(s) to fix these"
19912013 + " issues:\033 [0m\n "
19922014 + "\n "
0 commit comments